<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr"><head>
		<title>Notes for Pok&eacute;mon Essentials</title>
	</head>
	<body>
		<h1 id="notesforpokemonessentials">Notes for Pok&eacute;mon Essentials</h1>
		<p>Peter O. (http://upokecenter.com/projects/pokestarter/)</p>
		<p>For the latest version of this document, see: <a href="http://upokecenter.com/projects/pokestarter/notes.html">http://upokecenter.com/projects/pokestarter/notes.html</a></p>
		<p>For advanced topics, see the <a href="advanced.html">Advanced Topics</a> page.</p>
		<h2 id="contents">Contents</h2>
		<ul><li><a href="#notesforpokemonessentials">Notes for Pok&eacute;mon Essentials</a><ul><li><a href="#contents">Contents</a></li>
<li><a href="#controls">Controls</a></li>
<li><a href="#commonquestions">Common Questions</a><ul><li><a href="#howdoicreateapokemonmart">How do I create a Pok&eacute;mon Mart?</a></li>
<li><a href="#howcanihealthepartywithoutapokemoncenter">How can I heal the party without a Pok&eacute;mon Center?</a></li>
<li><a href="#howcanisetwheretheplayergoesafterlosingabattle">How can I set where the player goes after losing a battle?</a></li>
<li><a href="#howdoicreateananimatedtitlescreen">How do I create an animated title screen?</a></li>
<li><a href="#icanuseahiddenmoveevenwithoutapokemonabletodoso">I can use a hidden move even without a Pok&eacute;mon able to do so!</a></li>
</ul>
</li>
<li><a href="#basics">Basics</a><ul><li><a href="#anoteonscripting">A Note on Scripting</a></li>
<li><a href="#findinginformationabouttilesandmaps">Finding Information About Tiles and Maps</a></li>
</ul>
</li>
<li><a href="#upgradingfrompreviousversions">Upgrading from previous versions</a></li>
<li><a href="#problemwhenopeningproject">Problem when opening project</a></li>
<li><a href="#configurationfiles">Configuration Files</a><ul><li><a href="#datacompilation">Data Compilation</a></li>
<li><a href="#pbsconnectionstxt">PBS/connections.txt</a></li>
<li><a href="#pbsencounterstxt">PBS/encounters.txt</a></li>
<li><a href="#pbsmetadatatxt">PBS/metadata.txt</a></li>
<li><a href="#pbspokemontxt">PBS/pokemon.txt</a></li>
<li><a href="#pbsmovestxt">PBS/moves.txt</a></li>
<li><a href="#pbsitemstxt">PBS/items.txt</a><ul><li><a href="#implementingnewitems">Implementing New Items</a></li>
</ul>
</li>
<li><a href="#pbstrainernamestxt">PBS/trainernames.txt</a></li>
<li><a href="#pbstrainerstxt">PBS/trainers.txt</a></li>
<li><a href="#pbstmtxt">PBS/tm.txt</a></li>
</ul>
</li>
<li><a href="#townmapgeneratortownmapgenhtml">Town Map Generator (townmapgen.html)</a><ul><li><a href="#pointsofinterest">Points of Interest</a></li>
</ul>
</li>
<li><a href="#animations">Animations</a><ul><li><a href="#animationeditor">Animation Editor</a><ul><li><a href="#quickstart">Quick Start</a></li>
<li><a href="#editorfeatures">Editor Features</a></li>
</ul>
</li>
<li><a href="#battleanimations">Battle Animations</a></li>
</ul>
</li>
<li><a href="#gamescreens">Game Screens</a><ul><li><a href="#titlescreen">Title Screen</a></li>
<li><a href="#introscreen">Intro Screen</a></li>
</ul>
</li>
<li><a href="#resourcespecifications">Resource Specifications</a><ul><li><a href="#pokemongraphicsandicons">Pok&eacute;mon Graphics and Icons</a><ul><li><a href="#placementofsprites">Placement of Sprites</a></li>
<li><a href="#alternateforms">Alternate Forms</a></li>
</ul>
</li>
<li><a href="#itemicons">Item Icons</a></li>
<li><a href="#mailpreview">Mail Preview</a></li>
<li><a href="#pokemoncries">Pok&eacute;mon Cries</a></li>
<li><a href="#battlebackgrounds">Battle Backgrounds</a></li>
<li><a href="#trainergraphics">Trainer Graphics</a></li>
<li><a href="#trainerback">Trainer Back</a></li>
<li><a href="#fishinganimation">Fishing Animation</a></li>
<li><a href="#badgeimage">Badge Image</a></li>
<li><a href="#trainercard">Trainer Card</a></li>
<li><a href="#border">Border</a></li>
<li><a href="#backgrounds">Backgrounds</a></li>
<li><a href="#pokemontypesimage">Pok&eacute;mon Types Image</a></li>
<li><a href="#titles">Titles</a></li>
</ul>
</li>
<li><a href="#newwindowskinformat">New Window Skin Format</a></li>
<li><a href="#events">Events</a><ul><li><a href="#predefinedevents">Predefined Events</a><ul><li><a href="#trees">Trees</a></li>
<li><a href="#boulders">Boulders</a></li>
<li><a href="#headbutttrees">Headbutt Trees</a></li>
<li><a href="#crackedrocks">Cracked Rocks</a></li>
<li><a href="#doors">Doors</a><ul><li><a href="#eventpage1">Event Page 1</a></li>
<li><a href="#eventpage2">Event Page 2</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#cutscenes">Cut Scenes</a></li>
<li><a href="#switchesandvariables">Switches and Variables</a><ul><li><a href="#scriptbasedswitches">Script-Based Switches</a></li>
<li><a href="#temporaryselfswitches">Temporary Self-Switches</a></li>
<li><a href="#variables">Variables</a></li>
<li><a href="#eventspecificvariables">Event-Specific Variables</a></li>
</ul>
</li>
<li><a href="#timesensitiveevents">Time-Sensitive Events</a><ul><li><a href="#header71">Event Page 1</a></li>
<li><a href="#header72">Event Page 2</a></li>
<li><a href="#eventpage3">Event Page 3</a></li>
</ul>
</li>
<li><a href="#counterevents">Counter Events</a></li>
<li><a href="#sidestairs">Side Stairs</a><ul><li><a href="#onetiledeepsidestairs">One-Tile-Deep Side Stairs</a></li>
<li><a href="#sidestairsmorethantwotilesdeep">Side Stairs More than Two Tiles Deep</a></li>
</ul>
</li>
<li><a href="#randomprocessing">Random Processing</a></li>
<li><a href="#eventcommands">Event Commands</a></li>
<li><a href="#savingthegame">Saving the Game</a></li>
</ul>
</li>
<li><a href="#items">Items</a><ul><li><a href="#itemevents">Item Events</a></li>
<li><a href="#itemmanagement">Item Management</a><ul><li><a href="#checkingforitems">Checking for Items</a></li>
<li><a href="#addingremovingitems">Adding/Removing Items</a></li>
</ul>
</li>
<li><a href="#addingnewitems">Adding New Items</a><ul><li><a href="#keyitems">Key Items</a></li>
<li><a href="#technicalmachines">Technical Machines</a></li>
<li><a href="#hiddenmachine">Hidden Machine</a></li>
<li><a href="#regularitem">Regular Item</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#pokemonmart">Pok&eacute;mon Mart</a></li>
<li><a href="#checkingforpokemon">Checking for Pok&eacute;mon</a></li>
<li><a href="#pc">PC</a></li>
<li><a href="#wildpokemonbattles">Wild Pok&eacute;mon Battles</a></li>
<li><a href="#trainers">Trainers</a><ul><li><a href="#behindthescenes">Behind the Scenes</a></li>
<li><a href="#doubletrainerbattles">Double Trainer Battles</a></li>
<li><a href="#nightlytrainers">Nightly Trainers</a><ul><li><a href="#header99">Event Page 1</a></li>
<li><a href="#header100">Event Page 2</a></li>
</ul>
</li>
<li><a href="#partnertrainers">Partner Trainers</a></li>
<li><a href="#editingtrainersandbattles">Editing Trainers and Battles</a></li>
</ul>
</li>
<li><a href="#terraintags">Terrain Tags</a></li>
<li><a href="#trainerobject">Trainer Object</a></li>
<li><a href="#addingapokemon">Adding a Pok&eacute;mon</a><ul><li><a href="#addingapokemonownedbyanotherperson">Adding a Pok&eacute;mon Owned by Another Person</a></li>
<li><a href="#modifyingapokemonafteraddingit">Modifying a Pok&eacute;mon After Adding It</a></li>
<li><a href="#addinganegg">Adding an Egg</a></li>
</ul>
</li>
<li><a href="#removingapokemon">Removing a Pok&eacute;mon</a></li>
<li><a href="#graphicaleffects">Graphical Effects</a><ul><li><a href="#waterreflection">Water Reflection</a></li>
<li><a href="#lightsources">Light Sources</a></li>
<li><a href="#shadows">Shadows</a></li>
<li><a href="#particleengine">Particle Engine</a></li>
<li><a href="#transitions">Transitions</a></li>
<li><a href="#animatedpanoramasandfogs">Animated Images</a></li>
<li><a href="#gifsupport">GIF Support</a></li>
</ul>
</li>
<li><a href="#messagesystem">Message System</a><ul><li><a href="#usingthemessagesysteminotherprojects">Using the Message System in Other Projects</a></li>
</ul>
</li>
<li><a href="#backgroundmusic">Background Music</a><ul><li><a href="#defaultbackgroundmusic">Default Background Music</a></li>
<li><a href="#changingthebattlemusic">Changing the Battle Music</a></li>
<li><a href="#nightlymusic">Nightly Music</a></li>
</ul>
</li>
<li><a href="#localizationandtranslation">Localization and Translation</a></li>
<li><a href="#mapmakingconsiderations">Map Making Considerations</a><ul><li><a href="#avoidingblackregionsnearmapedge">Avoiding Black Regions Near Map Edge</a></li>
<li><a href="#canstillsurfonwaterevenwithabridgeoverit">Can still surf on water even with a bridge over it</a></li>
<li><a href="#gamefreezesduringmovement">Game freezes during movement</a></li>
</ul>
</li>
<li><a href="#commonmistakes">Common Mistakes</a></li>
<li><a href="#debugging">Debugging</a><ul><li><a href="#playtestingfunctions">Playtesting Functions</a></li>
<li><a href="#debugmenu">Debug Menu</a></li>
</ul>
</li>
<li><a href="#pokedex">Pokedex</a></li>
<li><a href="#townmap">Town Map</a></li>
<li><a href="#pokegear">Pokegear</a></li>
<li><a href="#runningshoes">Running Shoes</a></li>
<li><a href="#badges">Badges</a></li>
<li><a href="#phone">Phone</a></li>
<li><a href="#nameraterandmovedeleter">Name Rater and Move Deleter</a></li>
<li><a href="#coincaseandgamecoins">Coin Case and Game Coins</a></li>
<li><a href="#dependentevents">Dependent Events</a></li>
<li><a href="#movetutors">Move Tutors</a></li>
<li><a href="#bicycle">Bicycle</a></li>
<li><a href="#miscellaneous">Miscellaneous</a></li>
<li><a href="#suggestionsforcustomizingscripts">Suggestions for Customizing Scripts</a><ul><li><a href="#displayingaplayersuppliednameforatrainer">Displaying a Player-Supplied Name for a Trainer</a></li>
<li><a href="#shinywildpokemon">Shiny Wild Pok&eacute;mon</a></li>
<li><a href="#allowingaplayertoloseatrainerbattle">Allowing a Player to Lose a Trainer Battle</a></li>
<li><a href="#noshinypokemon">No Shiny Pok&eacute;mon</a></li>
<li><a href="#pokemontypes">Pok&eacute;mon Types</a></li>
</ul>
</li>
<li><a href="#controllingeventswithscripts">Controlling Events with Scripts</a><ul><li><a href="#pbwaitx">pbWait(x)</a></li>
<li><a href="#pbshakepowerspeedx">pbShake(power,speed,x)</a></li>
<li><a href="#pbflashcolorx">pbFlash(color,x)</a></li>
<li><a href="#pbtonechangealltoneduration">pbToneChangeAll(tone,duration)</a></li>
<li><a href="#pbmoverouteeventcommands">pbMoveRoute(event,commands)</a></li>
</ul>
</li>
<li><a href="#configuringtheserver">Configuring the Server</a><ul><li><a href="#publishingtheserver">Publishing the Server</a></li>
</ul>
</li>
<li><a href="#history">History</a><ul><li><a href="#october42008">October 4, 2008</a></li>
<li><a href="#september222008">September 22, 2008</a></li>
<li><a href="#september142008">September 14, 2008</a></li>
<li><a href="#september12008">September 1, 2008</a></li>
<li><a href="#august82008">August 8, 2008</a></li>
<li><a href="#july102008">July 10, 2008</a></li>
<li><a href="#july12008">July 1, 2008</a></li>
<li><a href="#june242008">June 24, 2008</a></li>
<li><a href="#june12008">June 1, 2008</a></li>
<li><a href="#may252008">May 25, 2008</a></li>
<li><a href="#may212008">May 21, 2008</a></li>
<li><a href="#may152008">May 15, 2008</a></li>
<li><a href="#may22008">May 2, 2008</a></li>
<li><a href="#april262008">April 26, 2008</a></li>
<li><a href="#march12008">March 1, 2008</a></li>
<li><a href="#february192008">February 19, 2008</a></li>
<li><a href="#february112008">February 11, 2008</a></li>
<li><a href="#february32008">February 3, 2008</a></li>
<li><a href="#january242008">January 24, 2008</a></li>
<li><a href="#january192008">January 19, 2008</a></li>
<li><a href="#january142008">January 14, 2008</a></li>
<li><a href="#january62008">January 6, 2008</a></li>
<li><a href="#january12008">January 1, 2008</a></li>
<li><a href="#december282007">December 28, 2007</a></li>
<li><a href="#december242007">December 24, 2007</a></li>
<li><a href="#december192007">December 19, 2007</a></li>
<li><a href="#december142007">December 14, 2007</a></li>
<li><a href="#december92007">December 9, 2007</a></li>
<li><a href="#december32007">December 3, 2007</a></li>
<li><a href="#november232007">November 23, 2007</a></li>
<li><a href="#november132007">November 13, 2007</a></li>
<li><a href="#november62007">November 6, 2007</a></li>
<li><a href="#october302007">October 30, 2007</a></li>
<li><a href="#october262007">October 26, 2007</a></li>
<li><a href="#october232007">October 23, 2007</a></li>
<li><a href="#october202007">October 20, 2007</a></li>
<li><a href="#october142007">October 14, 2007</a></li>
<li><a href="#october62007">October 6, 2007</a></li>
<li><a href="#october22007">October 2, 2007</a></li>
<li><a href="#september282007">September 28, 2007</a></li>
<li><a href="#september152007">September 15, 2007</a></li>
<li><a href="#september72007">September 7, 2007</a></li>
</ul>
</li>
</ul>
</li>
</ul>

		<!--
Byte 1: Function code. Moves are categorized according to their function. You can find a list of moves by function code in my attack list.
Byte 2: Base damage.
Byte 3: Type.
Byte 4: Accuracy (up to 100).
Byte 5: Move's total PP.
Byte 6: Additional effect chance (up to 100).
Byte 7: Target (see top of attack list for details).
Byte 8: Priority. Normally equal to 0.
Byte 9: Flags (see top of attack list for details).

-->
		<h2 id="controls">Controls</h2>
		<ul>
			<li>Z/Shift key - Dash</li>
			<li>Arrow keys - Move the characters</li>
			<li>X/Esc key - Opens the menu, cancels choices</li>
			<li>C/Enter/Space key - Confirms choices, used to talk to people</li>
			<li>F5 - Uses a registered item</li>
			<li>F8 - Takes a screenshot of the game.  Screenshots are stored on the game
folder and have names like capture000.bmp.</li>
			<li>F9 - Opens the debug menu (playtests only)</li>
		</ul>
		<p>Press Ctrl+X+Down during the title screen to delete save data.</p>
		<h2 id="commonquestions">Common Questions</h2>
		<h3 id="howdoicreateapokemonmart">How do I create a Pok&eacute;mon Mart?</h3>
		<p>To create a Pok&eacute;mon Mart, give the event a Script event command with
"pbPokemonMart([X])", where X is a list of the items available for purchase
there.  See <a href='#pokemonmart'>Pok&eacute;mon Mart</a> for details.</p>
		<p>Check the girl event next to the PC on Test Map 2 to see an example.</p>
		<h3 id="howcanicreatearivalandnamehim">How can I create a rival and name him?</h3>
<p>See the section "<a href='#displayingaplayersuppliednameforatrainer'>Displaying a Player-Supplied Name for a Person</a>."</p>
		<h3 id="howcanihealthepartywithoutapokemoncenter">How can I heal the party without a Pok&eacute;mon Center?</h3>
		<p>The event command "Recover All: Entire Party" was redefined in Pokemon
Essentials for just this purpose.  It works essentially the same as in
other RPG Maker XP games.</p>
		<h3 id="howcanisetwheretheplayergoesafterlosingabattle">How can I set where the player goes after losing a battle?</h3>
		<p>The point where the player goes after losing a battle depends on the last Pok&eacute;mon Center visited.  If no such Pok&eacute;mon Center was visited, the player goes to the point defined in the metadata setting called "Home" (set it in the editor, under "Set Metadata", then "Global").</p>
		<p>Though this approach is rarely necessary, you can also change the position within an event, by putting a Script event command consisting of the text "Kernel.pbSetPokemonCenter" within that event, which sets it to the player's current position. If you use this approach, there must be another event page on that event with an Autorun trigger and the condition "Switch '0005: Starting Over' is ON". That event page must heal all Pok&eacute;mon (use the event command "Recover All: Entire Party") and set the switch '0005: Starting Over' to OFF. For an example, see the event for any Pok&eacute;mon Center receptionist.</p>
		<h3 id="howdoicreateananimatedtitlescreen">How do I create an animated title screen?</h3>
		<p>There are a multitude of ways to create such a title screen, and the Scene_Intro class provided with Pokemon
Essentials is just one example of a title screen.  Please see the section <a href='#titlescreen'>Title Screen</a>, which includes a skeleton
that all custom title screens should follow.  For best results, name the class "Scene_Intro".  Please note that this 
is an <a href='#anoteonscripting'>advanced scripting feature</a>.</p>
		<h3 id="icanuseahiddenmoveevenwithoutapokemonabletodoso">I can use a hidden move even without a Pokemon able to do so!</h3>
		<p>This likely happened while you were playtesting a game.  This behavior is intentional.  It applies only 
when the game is run from debug mode, that is, when the game is playtested from RPG Maker XP.  It will 
not be the case when the game is run normally.  Please see <a href='#playtestingfunctions'>Playtesting Functions</a> for more information.</p>
		<h2 id="basics">Basics</h2>
		<h3 id="anoteonscripting">A Note on Scripting</h3>
		<p>This page cannot provide details on how to use the scripting language
Ruby.  For that, see the links provided in the Ruby language home page's 
<a href="http://www.ruby-lang.org/en/documentation/">Getting Started section</a>.
For reference material, consult the help file provided with RPG Maker XP.
For general information on RPG Maker XP and RGSS, please see the 
<a href="http://en.wikipedia.org/wiki/RPG_Maker_XP">Wikipedia article</a> on it.</p>
		<p>For advanced topics, see the <a href="advanced.html">Advanced Topics</a> page.</p>
		<h3 id="findinginformationabouttilesandmaps">Finding Information About Tiles and Maps</h3>
		<p>The status bar on the bottom of RPG Maker XP contains information about the map. Here is an example of a status bar:</p>
		<pre>
011: Test Map (30 x 28)
</pre>
		<p>The middle of the status bar shows the map ID (011), the name of the map (Test Map), and the width and height of the map (30 x 28)</p>
		<p>Now move your mouse over the map. Notice how another area on the status bar changes. This shows the X and Y coordinates of the point where the mouse currently is. Example: 013, 014 means that the mouse is pointing to the tile at X coordinate 13 and Y coordinate 14.</p>
		<h2 id="upgradingfrompreviousversions">Upgrading from previous versions</h2>
		<p>Since September 2007, there have been many releases of Pok&eacute;mon Essentials (see the <a href='#history'>history</a>),
so it may be helpful to learn how to upgrade to a new version.
If you modified the scripts in Pok&eacute;mon Essentials, then you should keep them separate as you replace them with the newer versions. Also, keep this in mind (posted by Flameguru):
</p>
		<blockquote>
			<p>Simple...well, maybe not. Here I go!</p>
			<p>First, make a copy of your entire projects folder. Then go into your games Data Folder. Copy over all of the Map Files, MapInfos, and the Tilesets data files.</p>
			<p>If you used any custom Tilesets or charsets or even pictures copy them over too, same for audio.</p>
			<p>Then go into the merged project and make an event and make it control switches. Then copy all of your switches from your game to the merged project.</p>
			<p>It's kind of confusing but it only takes 20 minutes max and it's what i have been doing this whole time</p>
		</blockquote>
		<h2 id="problemwhenopeningproject">Problem when opening project</h2>
		<p>If you are using RPG Tsukuuru XP in Japanese and you cannot open the project, then open Game.rxproj in Notepad and change "RPGXP 1.02" to "RPGXP 1.01" or, if necessary "RPGXP 1.00", then save the file.</p>
		<p>If you have problems opening the game, you may need to get the file "<a href="http://google.com/search?q=RGSS102E">RGSS102E.dll</a>", which is not included with Pok&eacute;mon Essentials.  Once you have that file, put it within the game's folder.  That file should be included in finished game projects if you are not sure whether users will possess that file.</p>
		<h2 id="configurationfiles">Configuration Files</h2>
		<p>Many aspects of the game can be customized by editing the .txt files contained in the PBS folder:</p>
		<ul>
			<li>items.txt - Data on items</li>
			<li>metadata.txt - Various settings, both global and map-specific.</li>
			<li>trainernames.txt - Names of the kinds of Trainers in the game.</li>
			<li>connections.txt - Map connection data</li>
			<li>encounters.txt - Data on encounters with wild Pokemon.</li>
			<li>trainers.txt - Data on Trainers</li>
			<li>townmap.txt - Data on the region map</li>
			<li>pokemon.txt - Data on Pok&eacute;mon</li>
		</ul>
		<p>For all configuration files, comment lines begin with a "#".
Each file must be saved in UTF-8 encoding.</p>
		<p>The file townmapgen.html in this distribution is designed for editing region maps.</p>
		<h3 id="datacompilation">Data Compilation</h3>
		<p>The configuration text files will be compiled into an internal format when the game is run from RPG Maker XP or when the $DEBUG global variable is set.  Normally this is done only if the text files have changed after the last run of the game.  However, you can force compilation by holding CTRL as the game loads.</p>
		<h3 id="pbsconnectionstxt">PBS/connections.txt</h3>
		<p>Pok&eacute;mon Essentials supports maps that connect to each other seamlessly. This file defines connection points of maps 
with others in the game.   However, an easier way to edit map connections is to use the "Visual Editor" option on the Pokemon Essentials editor (editor.exe).</p>
		<h3 id="pbsencounterstxt">PBS/encounters.txt</h3>
		<p>This text file is for placing encounter data for each map.   However, an easier way to edit Pok&eacute;mon encounters
is to use the "Set Encounters" option on the Pok&eacute;mon Essentials editor (editor.exe).  That method is also preferred.</p>
		<h3 id="pbsmetadatatxt">PBS/metadata.txt</h3>
		<p>This text file describes metadata on each map in the game.   However, an easier way to edit metadata
is to use the "Set Metadata" option on the Pok&eacute;mon Essentials editor (editor.exe).  That method is also preferred.</p>
		<h3 id="pbspokemontxt">PBS/pokemon.txt</h3>
		<p>This text file describes each Pok&eacute;mon in the game. The file is divided into sections, and each section's title is the Pok&eacute;mon's number (in the National Pokedex order) enclosed by two square brackets like this: [120]</p>
		<p>Each section can have any number of entries. The entry's name and the entry's value are separated by an equal sign (=).</p>
		<p>Here are the possible entry types:</p>
		<ul>
			<li>Name - Name of the Pokemon.</li>
			<li>InternalName - Internal name of the Pokemon.</li>
			<li>Kind - The kind of Pokemon.</li>
			<li>RegionalNumbers - The order of this Pok&eacute;mon in one or more regional Pokedexes; 
for example, Treecko is number 1 in the Hoenn Pokedex. This is a comma-separated list of numbers.  
If at least one of the numbers is 0, then a species doesn't exist in at least one regional Pokedex.  
This setting is optional.
To manipulate regional and national Pokedex numbers, use the functions pbAllRegionalSpecies,
pbGetNationalNumber, and pbGetRegionalNumber in the script section PokemonUtilities.  See the comments
within those functions for more information.
</li>
			<li>Pokedex - Description of the Pok&eacute;mon as shown in the Pokedex.</li>
			<li>Color - Body color of the Pok&eacute;mon. One of Red, Blue, Yellow, Green, Black, Brown, Purple, Gray, White, Pink.</li>
			<li>Type1 - Type 1 of the Pok&eacute;mon. Required.</li>
			<li>Type2 - Type 2 of the Pok&eacute;mon. Optional.  If this is omitted, this Pok&eacute;mon has a single type.</li>
			<li>Height - Height in meters, rounded to the nearest tenth of a meter.</li>
			<li>Weight - Weight in kilograms, rounded to the nearest tenth of a kilogram.</li>
			<li>GenderRate - Gender rate of the Pok&eacute;mon. One of FemaleOneEighth, Female25Percent, Female50Percent, Female75Percent, AlwaysMale, AlwaysFemale, or Genderless.</li>
			<li>BaseStats - Base stats of the Pok&eacute;mon for HP, Attack, Defense, Speed, Special Attack, and Special Defense. 
A comma-separated list of six numbers, each ranging from 0 through 255.</li>
			<li>Rareness - Catch rate. A higher number means the species is easier to catch. From 0 through 255.</li>
			<li>BaseEXP - Base experience. A higher number means more experience is gained when the species is defeated. From 0 through 255.</li>
			<li>Happiness - Starting happiness when caught.  From 0 through 255.  Normally equal to 70.</li>
			<li>GrowthRate - Growth rate. One of Fast, Medium, Slow, Parabolic, Erratic, or Fluctuating.</li>
			<li>StepsToHatch - Number of steps required before egg hatches. Should be a multiple of 256.  Normally 5120.</li>
			<li>WildItemCommon - Item commonly found in this species in the wild.  Optional.</li>
			<li>WildItemRare - Item rarely found in this species in the wild.  Optional.</li>
			<li>Compatibility - Compatibility with other species for breeding purposes. A comma-separated list of two numbers. If either number is 15, this species cannot breed.
<ul><li>Meaning of each number: 1="Monster"; 2="Water1"; 3="Bug"; 4="Flying",
      5="Ground", 6="Fairy", 7="Plant", 8="Humanshape", 9="Water3",
      10="Mineral", 11="Indeterminate", 12="Water2", 13="Ditto", 14="Dragon"</li></ul></li>
			<li>EffortPoints - Effort values for HP, Attack, Defense, Speed, Special Attack, and Special Defense, 
earned when the species is defeated. A comma-separated list of six numbers, each ranging from 0 through 3.</li>
			<li>Abilities - One or two abilities possible for this species.</li>
			<li>Moves - Third-generation moves learned by this species by gaining levels. This is a comma-separated list consisting of pairs of move-level entries.
<ul><li>Example: 1,TACKLE,4,GROWL,7,LEECHSEED,10,VINEWHIP,15,POISONPOWDER,15,SLEEPPOWDER,20,RAZORLEAF,25,SWEETSCENT,32,GROWTH,39,SYNTHESIS,46,SOLARBEAM</li></ul>
</li>
			<li>Evolutions - Evolved forms of this species. This is a comma-separated list consisting of triples of entries, where the first is the evolved form, the second is the evolution type, and the third is data that depends on the evolution type. Evolution types are:
<table>
					<tr>
						<th>Field 2's value</th>
						<th>Field 3's value</th>
					</tr>
					<tr>
						<td>Happiness</td>
						<td>---</td>
					</tr>
					<tr>
						<td>HappinessDay</td>
						<td>---</td>
					</tr>
					<tr>
						<td>HappinessNight</td>
						<td>---</td>
					</tr>
					<tr>
						<td>Level</td>
						<td>Level</td>
					</tr>
					<tr>
						<td>Trade</td>
						<td>---</td>
					</tr>
					<tr>
						<td>TradeItem</td>
						<td>Item's internal name</td>
					</tr>
					<tr>
						<td>Item</td>
						<td>Item's internal name</td>
					</tr>
					<tr>
						<td>AttackGreater</td>
						<td>Level</td>
					</tr>
					<tr>
						<td>AtkDefEqual</td>
						<td>Level</td>
					</tr>
					<tr>
						<td>DefenseGreater</td>
						<td>Level</td>
					</tr>
					<tr>
						<td>Silcoon</td>
						<td>Level</td>
					</tr>
					<tr>
						<td>Cascoon</td>
						<td>Level</td>
					</tr>
					<tr>
						<td>Ninjask</td>
						<td>Level</td>
					</tr>
					<tr>
						<td>Shedinja</td>
						<td>Level</td>
					</tr>
					<tr>
						<td>Beauty</td>
						<td>Minimum Beauty factor</td>
					</tr>
					<tr><td>ItemMale</td><td>Item's internal name</td></tr>
					<tr><td>ItemFemale</td><td>Item's internal name</td></tr>
					<tr><td>DayHoldItem</td><td>Item's internal name</td></tr>
					<tr><td>NightHoldItem</td><td>Item's internal name</td></tr>
					<tr><td>HasMove</td><td>Move's internal name</td></tr>
					<tr><td>HasInParty</td><td>Species's internal name</td></tr>
					<tr><td>LevelMale</td><td>Level</td></tr>
					<tr><td>LevelFemale</td><td>Level</td></tr>
					<tr><td>Special1</td><td>-</td></tr>
					<tr><td>Special2</td><td>-</td></tr>
					<tr><td>Special3</td><td>-</td></tr>
					<tr><td>Custom1</td><td>Number from 0 through 65535</td></tr>
					<tr><td>Custom2</td><td>Number from 0 through 65535</td></tr>
					<tr><td>Custom3</td><td>Number from 0 through 65535</td></tr>
					<tr><td>Custom4</td><td>Number from 0 through 65535</td></tr>
					<tr><td>Custom5</td><td>Number from 0 through 65535</td></tr>
					<tr><td>Custom6</td><td>Number from 0 through 65535</td></tr>
					<tr><td>Custom7</td><td>Number from 0 through 65535</td></tr>
				</table>
				<p>For the custom evolution types, the number given is used as one of the parameters to the evolution-checking
function within the script section PokemonEvolution.  In the function pbMiniCheckEvolution, there are areas of code
such as "Add code for custom evolution type X" where you can add a custom evolution check.  The function has four
parameters: "pokemon", which is the Pok&eacute;mon to be checked; "evonib", which is the evolution type; "level", which is
the level or other parameter; and "poke", which is the species to evolve to.  Here is code for an example evolution type
where a Pok&eacute;mon species evolves if it is raining:</p>
				<pre>
return poke if $game_screen &amp;&amp; $game_screen.weather==1 || $game_screen.weather==2
</pre>
				<p>And here is a more complex evolution check where a Pok&eacute;mon evolves only if it is well trained (that is, if its
total effort values meet or exceed a certain amount):</p>
				<pre>
evtotal=0
for i in 0...6
 evtotal+=pokemon.ev[i]
end
return poke if evtotal&gt;=level
</pre>
				<p>The parameter here, marked as "level", can be 300, for example.</p>
			</li>
			<li>EggMoves - Third-generation moves that the species can learn only as an egg. This data is valid 
only if the species is in its lowest evolutionary form.
<ul><li>Example: LIGHTSCREEN,SKULLBASH,SAFEGUARD,CHARM,PETALDANCE</li></ul></li>
			<li>Machines - This setting is no longer used because Technical and Hidden Machines
are now supported differently, see <a href='#pbstmtxt'>PBS/tm.txt</a> and <a href='#technicalmachines'>Technical Machines</a>.</li>
			<li>BattlerPlayerY - Specifies the relative position of the back of the sprite 
(<b>Graphics/Battlers/XXXb.png</b>) on the battle screen.  A higher number means the back sprite is placed lower on the screen.</li>
			<li>BattlerEnemyY - Specifies the relative position of the front side sprite 
(<b>Graphics/Battlers/XXX.png</b>) on the battle screen.  A higher number means the front side sprite is placed lower on the screen.</li>
			<li>BattlerAltitude - Specifies how far from the ground the front sprite is placed, that is, this value will be higher than 0 if the sprite has the appearance of being suspended in the air.  A higher number means the front sprite is placed further from the ground.</li>
		</ul>
		<p>For information on Pok&eacute;mon graphics, see <a href='#pokemongraphicsandicons'>Pok&eacute;mon Graphics and Icons</a>.</p>
		<h3 id="pbsmovestxt">PBS/moves.txt</h3>
		<p>This file stores data on each move in the game. It will be converted to a runtime format when you run a playtest of the game from RPG Maker XP. Each line contains data on one move and is divided into fields separated by commas:</p>
		<ul>
			<li>Field 1: ID of the move.</li>
			<li>Field 2: Name used internally, as in scripts, to refer to the move.</li>
			<li>Field 3: Name of the move as displayed in the game.</li>
			<li>Field 4: Function code of the move.  A hexadecimal value.  See the 
<a href="http://upokecenter.com/games/rs/guides/attacks.html">list of moves</a> for the
meaning of each function code.  In that page, the function code for that move is located before the description of each move's effect.</li>
			<li>Field 5: Base damage.</li>
			<li>Field 6: Type.</li>
			<li>Field 7: Move category, either Physical, Special, or Status.  As of the January 19 release, the game will
use this category instead of type to determine whether an attack is physical or special. Set to Status 
if the base damage is 0.</li>
			<li>Field 8: Accuracy of the move, up to 100.  Set to 0 if the move has no opponent as a target.</li>
			<li>Field 9: Total PP.</li>
			<li>Field 10: Additional effect chance, up to 100.  The meaning of the additional effect
depends on the move's function code (field 4).</li>
			<li>Field 11: Target.  A hexadecimal value.<ul>
					<li>00 - Single Pok&eacute;mon other than the user</li>
					<li>01 - No target</li>
					<li>04 - Opposing Pok&eacute;mon selected at random</li>
					<li>08 - All opposing Pok&eacute;mon</li>
					<li>10 - User</li>
					<li>20 - All Pok&eacute;mon other than the user</li>
					<li>40 - Opposing Pok&eacute;mon's side</li>
				</ul></li>
			<li>Field 12: Priority.  Normally, this value is 0, but set to a positive number to make it strike earlier than normal attacks,
or to a negative number to make it strike later.  For moves like Quick Attack, this should equal 1.</li>
			<li>Field 13: Flags:<ul>
					<li>a: This is a direct attack, where the attacker makes direct contact with the opponent.</li>
					<li>b: The opponent can use Protect or Detect to protect itself from this move.</li>
					<li>c: The opponent can use Magic Coat to redirect the effect of this move. Use this flag
if the move deals no damage but causes a negative effect on an opponent.</li>
					<li>d: The opponent can use Snatch to steal the effect of this move.  Use this flag
for most moves that target the user. (Flags c and d are mutually exclusive.)</li>
					<li>e: The game does an accuracy check for this move, the accuracy field should not be 0.</li>
					<li>f: If the user holds a King's Rock, the opponent may flinch after the attacker uses this attack.</li>
				</ul></li>
			<li>Field 14: Contest type, either Cool, Beauty, Cute, Smart, or Tough.</li>
			<li>Field 15: Description of the move.</li>
		</ul>
		<h3 id="pbsitemstxt">PBS/items.txt</h3>
		<p>This file stores data on each item in the game. It will be converted to a runtime format when you run a playtest of the game from RPG Maker XP. 
For examples, see <a href='#addingnewitems'>Adding New Items</a>.  Each line contains data on one item and is divided into fields separated by commas:</p>
		<ul>
			<li>Field 1: ID of the item. To define an item, assign it a unique ID number. 
The ID 0 is reserved for internal use. Also, item IDs cannot be negative. (Although it's customary to make
the item ID three digits long, in reality the number of possible items is unlimited.)</li>
			<li>Field 2: Name used internally, as in scripts, to refer to the item.</li>
			<li>Field 3: Name of the item as displayed in the game.</li>
			<li>Field 4: Pocket of the Bag where this item is placed:
<ul>
					<li>1: Items</li>
					<li>2: PokeBalls</li>
					<li>3: TMs and HMs</li>
					<li>4: Berries</li>
					<li>5: Key Items</li>
				</ul>
			</li>
			<li>Field 5: Purchase price of the item. Items can be sold for half their purchase price. Items with a purchase price of 0 cannot be sold and should not appear in shops. This should be true of all Key Items.</li>
			<li>Field 6: Description of the item. If the description contains commas or quotation marks it must be contained within quotation marks and the quotation marks within the description must be preceded by the "\" symbol. For consistency, though, putting all descriptions in quotation marks is preferred.</li>
			<li>Field 7: Usability of the item outside of battle. This setting can have one of these values:
<ul>
					<li>0: This item can't be used outside of battle.</li>
					<li>1: This item can be used on a Pok&eacute;mon. When this item is chosen, a screen appears allowing the player to choose a Pok&eacute;mon. This setting does not apply to TMs and HMs.</li>
					<li>2: Other items that can be used outside of battle.</li>
					<li>3: This item is a <a href='#technicalmachines'>technical machine</a>.</li>
					<li>4: This item is a hidden machine.</li>
				</ul>
			</li>
			<li>Field 8: Usability of the item within a battle. This setting can have one of these values:
<ul>
					<li>0: This item can't be used in battle.</li>
					<li>1: This item can be used on a Pok&eacute;mon. When this item is chosen, a screen appears allowing the player to choose a Pokemon.</li>
					<li>2: This item is a Ball for catching Pok&eacute;mon or can be used directly from the Bag screen.</li>
					<li>3: Same as 1, but the item is reusable.</li>
				</ul>
			</li>
			<li>Field 9: For special kinds of items.<ul>
					<li>0: This item has no special type.</li>
					<li>1: This item is a Mail.</li>
					<li>2: This item is a Mail, where an image of the holder will appear on the mail.</li>
					<li>3: This item is a Snag Ball.</li>
				</ul>
			</li>
		</ul>
		<p>Also, an icon of the item must be placed in the Graphics/Icons folder with a filename of itemXXX.png, where XXX is the ID number of the item, left-padded with zeros. The icon's dimensions must be 48x48.</p>
		<p>Comment lines begin with "#". This file, however, doesn't allow comments at the end of the line.</p>
		<h4 id="implementingnewitems">Implementing New Items</h4>
		<p>The following describes an <a href='#anoteonscripting'>advanced scripting feature</a>.</p>
		<p>New items are implemented by registering <em>item handlers</em> with the game system.  Fields 7 and 8 of items.txt give
the moments where an item can be used.  These fields determine which handlers an item should implement.
There are five different item handlers for an item, corresponding to the moments where items are used:</p>
		<ul>
			<li>ItemHandlers.addUseFromBag(item,proc) - Registers the item handler _proc_ for an item that can be used directly
from the Bag, such as a bicycle, Repel, or the Town Map.  Parameters:
<ul>
					<li>_item_ - item to be used</li>
				</ul>
			</li>
			<li>ItemHandlers.addUseInField(item,proc) - Registers the item handler _proc_ for an item that can be used on the field
by pressing F5. Parameters:
<ul>
					<li>_item_ - item to be used</li>
				</ul>
			</li>
			<li>ItemHandlers.addUseOnPokemon(item,proc) - Registers the item handler _proc_ for an item that can be used on a Pokemon.
 Parameters:
<ul>
					<li>_item_ - item to be used</li>
					<li>_pokemon_ - Pok&eacute;mon the item will be used on (type: PokeBattle_Pokemon)</li>
					<li>_scene_ - Pok&eacute;mon selection screen (type: PokemonScreen). Often only used to display a message, and is often used like this: 
<samp>scene.pbDisplay(_INTL("Message."))</samp></li>
				</ul>
The item handler returns true if the item was used, and false otherwise.
</li>
			<li>ItemHandlers.addUseOnPokemon(item,proc) - Registers the item handler _proc_ for an item that can be used on a Pokemon
while in battle.  Examples include Potion, Revive, and Full Heal.  Parameters:
<ul>
					<li>_item_ - item to be used</li>
					<li>_pokemon_ - Pok&eacute;mon the item will be used on (type: PokeBattle_Pokemon)</li>
					<li>_battler_ - Battler object, if _pokemon_ is one of the active Pok&eacute;mon (type: PokeBattle_Battler); nil otherwise</li>
					<li>_scene_ - Pok&eacute;mon selection screen (type: PokemonScreen).</li>
				</ul>
The item handler returns true if the item was used, and false otherwise.
</li>
			<li>ItemHandlers.addUseOnBattler(item,proc) - Registers the item handler _proc_ for an item that can be used on a battler
while in battle.  Examples include X Attack and Guard Spec.  Parameters:
<ul>
					<li>_item_ - item to be used</li>
					<li>_battler_ - Battler the item will be used on (type: PokeBattle_Battler)</li>
					<li>_scene_ - Bag screen (type: PokemonBagScreen).</li>
				</ul>
The item handler returns true if the item was used, and false otherwise.
</li>
		</ul>
		<p>The following gives some guidance on the item handlers that an item should implement depending on its usability.</p>
		<p>Field 7 (usability outside of battle)</p>
		<ul>
			<li>If Field 7 is 1, the function ItemHandlers.addUseOnPokemon should be called for that item.</li>
			<li>If Field 7 is 2, the function ItemHandlers.addUseFromBag should be called for that item.  If the item is a key item,
it should also implement ItemHandlers.addUseInField.</li>
		</ul>
		<p>Field 8 (usability in battle)</p>
		<ul>
			<li>If Field 8 is 1 or 3, the function ItemHandlers.addBattleUseOnPokemon should be called for that item.</li>
			<li>If Field 8 is 2, the function ItemHandlers.addBattleUseOnBattler should be called for that item.</li>
		</ul>
		<p>The following shows some examples of item handlers for a hypothetical item called "Cake", which restores
30 HP to a Pok&eacute;mon.  For completeness, it implements all five item handlers.</p>
		<pre>
# Handlers implemented
ItemHandlers.addUseFromBag(
 PBItems::CAKE,
 proc{|item,pokemon,scene|
  pbHPItem(pokemon,30,scene)
 }
)
ItemHandlers.addBattleUseOnBattler(
 PBItems::CAKE,
 proc{|item,pokemon,battler,scene|
  pbBattleHPItem(pokemon,battler,30,scene)
 }
)
# Handlers not implemented
ItemHandlers.addUseFromBag(
 PBItems::CAKE,
 proc{|item| 0; }
)
ItemHandlers.addUseInField(
 PBItems::CAKE,
 proc{|item| 
  Kernel.pbMessage(_INTL("Can't use that here."))
 }
)
ItemHandlers.addBattleUseOnPokemon(
 PBItems::CAKE,
 proc{|item,battler,scene| false; }
)
</pre>
		<h3 id="pbstrainernamestxt">PBS/trainernames.txt</h3>
		<p>This file stores data on each trainer type.  However, an easier way to edit trainer types
is to use the "Trainer Types" option on the Pok&eacute;mon Essentials editor (editor.exe).  That method is also preferred.</p>
		<h3 id="pbstrainerstxt">PBS/trainers.txt</h3>
		<p>This text file stores data on each Trainer in the game.  However, an easier way to edit trainers and trainer battles
is to use the "Edit Trainers" option on the Pok&eacute;mon Essentials editor (editor.exe).  That method is also preferred.</p>
		<h3 id="pbstmtxt">PBS/tm.txt</h3>
		<p>Very simple file.  It consists of a list of moves and the species that can learn each move.  Used in TMs/HMs.</p>
		<h2 id="townmapgeneratortownmapgenhtml">Town Map Generator (townmapgen.html)</h2>
		<p>The Town Map editor is designed to make editing the region map easier.</p>
		<p>When the editor is started, it loads the file at Graphics/Pictures/Map.png. You can replace that file with the map of your game's region, keeping in mind that the map should be drawn in terms of 16x16 tiles. The example map in the distribution is the map of Hoenn; and filling the map will give you a good idea on how the Town Map Editor works.</p>
		<p>Start by clicking any point on the map; for instance a city. Once you have done so, fill in details about the point:</p>
		<ul>
			<li>Name: Name described by this point.</li>
			<li>Point of Interest: Name of a <a href='#pointsofinterest'>point of interest</a> described by this point.</li>
			<li>Healing Spot: This field specifies the map ID and the X and Y coordinates of the entrance of a healing spot, such as a Pok&eacute;mon Center, separated by commas. This location is where the player will travel to when Fly is used and if the map indicated by the map ID was visited before. Generally set only if the location is a city or town.</li>
			<li>Switch: Number of a switch (in RPG Maker XP). If this is set, the point will not be shown until the switch is on. This field is generally set for locations outside of the main storyline, where special Pok&eacute;mon can be found.</li>
		</ul>
		<p>After completing the fields, click Save. You will notice that the point is added to the text below the Save button. This text is meant to be pasted to townmap.txt after you are done with the editor. You can put the text in a new or existing section of the file. (Sections begin with a number within brackets, for example: [1])</p>
		<p>The next time you use the map editor, you can paste a section from townmap.txt (without the section heading) onto the big text box and click Load to resume editing.</p>
		<h3 id="pointsofinterest">Points of Interest</h3>
		<p>The "Point of Interest" setting is meant to describe an entrance to a cave, the location of an important zone (preferably one with RPGXP maps of its own), or anything interesting within the main location described by the point. Examples:</p>
		<pre>
0,0,"FUCHSIA CITY","SAFARI ZONE",,
2,2,"ROUTE 111","DESERT",,
4,3,"ROUTE 220","LOST TOWER",,
6,6,"LAVENDER CITY","POKeMON TOWER",,
8,8,"EVER GRANDE CITY","VICTORY ROAD",,
</pre>
		<p>However, that setting should not be used to name a building within a city or town, as in these cases:</p>
		<pre>
0,0,"SAFFRON CITY","SILPH CO.",,
5,0,"RUSTBORO CITY","DEVON CORPORATION",,
3,3,"VEILSTONE CITY","GAME CORNER",,
</pre>
		<p>In most cases, however, the Point of Interest setting is left blank, since the number of points of interest is generally small within a game.</p>
		<h2 id="animations">Animations</h2>
		<p>The battle system allows the animations to be customized.  Currently, almost all
of the animations are of the move Tackle.  There are two ways to add move animations--
<a href='#battleanimations'>using RPG Maker XP</a> or using the in-game <a href='#animationeditor'>Animation Editor</a>.</p>
		<h3 id="animationeditor">Animation Editor</h3>
		<p>The Animation Editor is designed for creating Pok&eacute;mon battle animations.
A separate editor is necessary because the animations for many moves
require the attacker and the target to be manipulated.</p>
		<p>The Animation Editor is located on the game's Debug menu.</p>
		<h4 id="quickstart">Quick Start</h4>
		<p>The controls at the bottom left of the window are important ones when
working with the editor.  The "Frame:" control changes the number of frames;
"Set Animation Bitmap" changes the bitmap used for animations; 
"Frames:X" lets you set the number of frames; and you can rename or 
add more animations by clicking List of Animations.</p>
		<p>The animation palette is located just above the name window.  Click the 
left and right arrows to scroll the palette, and click on an object in the
palette to select it.  Clicking on the canvas will then place the object on it
as a cell.  To select an existing cell, click on it.  You can then move it,
press L to lock it, preventing movement, or press P to open its properties.</p>
		<p>Animations will be saved in the file Data/PkmnAnimations.rxdata.</p>
		<h4 id="editorfeatures">Editor Features</h4>
		<p>Here are descriptions of the editor's controls:</p>
		<ul>
			<li>Frame:  Changes the current frame.</li>
			<li>Set Animation Bitmap:  Sets the bitmap file that contains the objects used
in the animation.</li>
			<li>Frames:  Shows the number of frames.  Click to change the number of frames.</li>
			<li>Name:  Shows the animation's name.</li>
			<li>List of Animations:  Shows the list of animations.
     Here you can select an animation.  Press F5 to rename an animation,
     or change the number of animations by modifying the number under "Animations"
     and clicking "Resize Animation List".  Press ESC to close.</li>
			<li>Paste Last:  Copies the last frame to this frame.</li>
			<li>Copy Frames:  Copies a sequence of frames elsewhere.<ul>
					<li>     First Frame:  First frame in the sequence of frames to copy. The first frame is numbered 0.</li>
					<li>     Last Frame:  Last frame in the sequence of frames to copy.</li>
					<li>     Copy to:  Makes this frame equal to (First Frame), makes the next frame
         equal to (First Frame + 1), and so on.</li>
				</ul></li>
			<li>Clear Frames:  Deletes all cells in each frame except locked cells.<ul>
					<li>     First Frame:  First frame in the sequence of frames to clear.</li>
					<li>     Last Frame:  Last frame in the sequence of frames to clear.</li>
				</ul></li>
			<li>Tweening:  Interpolates the cells between one frame and another frame
for a smoother animation.<ul>
					<li>     Starting Frame: Frame containing the starting positions of cells to interpolate.</li>
					<li>     Ending Frame: Frame containing the ending positions of cells to interpolate.</li>
					<li>     First Cel:  First cell in the sequence of cells to interpolate.</li>
					<li>     Last Cel:  Last cell in the sequence of cells to interpolate.</li>
					<li>     Pattern:  If checked, the pattern of each cell will be interpolated.</li>
					<li>     Position/Zoom/Angle:  If checked, the position of each cell will be interpolated.</li>
					<li>     Opacity/Blending:  If checked, the transparency of each cell will be interpolated.</li>
				</ul></li>
			<li>Cell Batch:  Modifies multiple cells at once.<ul>
					<li>     First Frame:  First frame in the sequence of frames to modify.</li>
					<li>     Last Frame:  Last frame in the sequence of frames to modify.</li>
					<li>     First Cel:  First cell in the sequence of cells to modify within the specified frames.</li>
					<li>     Last Cel:  Last cell in the sequence of cells to modify within the specified frames.</li>
					<li>     Click the checkboxes on the right side to specify which parameters to modify
     on the selected cells.</li>
				</ul></li>
			<li>Entire Slide:  Shifts the position of all cells in one or more frames.<ul>
					<li>     First Frame:  First frame in the sequence of frames to shift.</li>
					<li>     Last Frame:  Last frame in the sequence of frames to shift.</li>
					<li>     X-Axis Movement:  A negative value means shift left, a positive value
        means shift right.</li>
					<li>     Y-Axis Movement:  A negative value means shift up, a positive value
        means shift down.</li>
				</ul></li>
			<li>Sounds:  Set the sounds to play for this animation.
     In this screen, choose a sound to modify its filename, volume, and pitch,
     or choose "Add New Sound" to add a new one. To change the sound's frame,
     select a frame and click "Set Frame".  Finally, to delete a sound, select it and
     choose "Delete Sound Effect".</li>
			<li>Play:  Plays this animation.</li>
			<li>Help:  View help.</li>
		</ul>
		<p>The animation palette is located just above the name window.  Click the 
left and right arrows to scroll the palette, and click on an object in the
palette to select it.  Clicking on the canvas will then place the object on it
as a cell.</p>
		<p>To select a cell, simply click on it.  Holding Alt will enable finer selection of 
cels on the screen.  If a frame is selected, the following actions are available:</p>
		<ul>
			<li>L:  Lock or unlock a cell.  Locking a cell prevents it from being moved
 or deleted. </li>
			<li>Delete:  Delete</li>
			<li>E:  Rotate left.</li>
			<li>R:  Rotate right.</li>
			<li>P:  Open properties screen.</li>
			<li>Right click:  Open menu.</li>
			<li>Arrow keys:  Move cell 8 pixels (hold Alt for 2 pixels).</li>
			<li>+ (numeric pad):  Zoom in</li>
			<li>- (numeric pad):  Zoom out</li>
		</ul>
		<h3 id="battleanimations">Battle Animations</h3>
		<p>There are several rules to keep in mind when making battle animations in RPG Maker XP.</p>
		<ul>
			<li>Battle animations for moves must be named Move:XXX, where XXX is the internal
name of the move as defined in PBS/moves.txt.  For instance, the animation for
Fire Punch will be named Move:FIREPUNCH.</li>
			<li>When creating animations that involve an attacker and an opponent, the
point at (-160,80) is considered to be the attacker, and the point at (160,-80)
is considered to be the opponent. The animation must have a "position" of "Screen."
As a guide, you can use the file battlers.png (under "[ED] Battler..."). (Moves that the user uses on itself, as well as common
animations [see below], should not use this technique.)</li>
			<li>The next time you run the game from RPG Maker XP, the game will convert any animations
here to a different format so that they will display properly in the battle system.</li>
			<li>Certain animations are commonly used and have special names for them:<ul>
					<li>Common:Shiny - When a shiny (different-colored) Pok&eacute;mon enters battle.</li>
					<li>Common:StatUp - When a Pok&eacute;mon's stat was raised.</li>
					<li>Common:StatDown - When a Pok&eacute;mon's stat was lowered.</li>
					<li>Common:Frozen - When a Pok&eacute;mon is frozen.</li>
					<li>Common:Burn - When a Pok&eacute;mon is burned.</li>
					<li>Common:Sleep - When a Pok&eacute;mon is asleep.</li>
					<li>Common:Paralysis - When a Pok&eacute;mon is paralyzed.</li>
					<li>Common:Confusion - When a Pok&eacute;mon is confused.</li>
				</ul></li>
		</ul>
		<h2 id="gamescreens">Game Screens</h2>
		<h3 id="titlescreen">Title Screen</h3>
		<p>The game's title screen can be changed by replacing the files Pic_1.png , Pic_2.png , and Start.png . 
Each of these files is found in the directory Graphics/Titles.  The files can be animated GIF files (with the same filename and extension).</p>
		<p>Essentially, though, the title screen just calls the game-loading screen. Here is an example of a very simple title scene:</p>
		<pre>
 class Scene_Xxxx
   def main
     # Prepare scene
     Graphics.transition
     while $scene != self
        Graphics.update
        Input.update
        update
     end     
     Graphics.freeze
     # Dispose sprites
   end
   def update
     if Input.trigger?(Input::C)
       # Close scene here
       sscene=PokemonLoadScene.new
       sscreen=PokemonLoad.new(sscene)
       sscreen.pbStartLoadScreen # Will change scene if appropriate
     end
   end
 end
</pre>
		<p>The title's music can be changed with the "Title BGM" setting in the System tab of the database.</p>
		<h3 id="introscreen">Intro Screen</h3>
		<p>The introduction screen when the game starts is found in the map titled Intro. This map should be where the starting position is placed. It also contains an event with an autorun trigger. The event may appear long, but that's only because it's a representative appearance of the intro screen only. The most fundamental introduction event looks like the following:</p>
		<pre>
@&gt;<span style="color:rgb(0,128,0)">Comment: Initializes the player character.</span>
@&gt;<span style="color:rgb(128,128,128)">Script: pbChangePlayer(0)</span>
@&gt;<span style="color:rgb(0,128,0)">Comment: opens the name entry screen and initializes the </span>
 : <span style="color:rgb(0,128,0)">        : Trainer object</span>
@&gt;<span style="color:rgb(128,128,128)">Script: pbTrainerName</span>
@&gt;<span style="color:rgb(0,128,0)">Comment: Displays the player's name</span>
@&gt;<span style="color:rgb(0,0,0)">Text: Hello, \PN.</span>
@&gt;<span style="color:rgb(0,128,0)">Comment: Stops autorun event</span>
@&gt;<span style="color:rgb(255,0,0)">Control Self Switch: A =ON</span>
@&gt;<span style="color:rgb(0,128,0)">Comment: Transfers player to start position</span>
@&gt;<span style="color:rgb(128,0,0)">Transfer Player:[011: Test Map], (009, 009), Down</span>
@&gt;
</pre>
		<p>Of course, it can be expanded to include multiple player characters and to show the character on screen:</p>
		<pre>
@&gt;<span style="color:rgb(0,0,0)">Text: Are you a boy or a girl?</span>
@&gt;<span style="color:rgb(0,0,0)">Show Choices: BOY, GIRL</span>
 : <span style="color:rgb(0,0,0)">When [BOY]</span>
  @&gt;<span style="color:rgb(0,128,0)">Comment: initializes player 0 (PlayerA)</span>
  @&gt;<span style="color:rgb(128,128,128)">Script: pbChangePlayer(0)</span>
  @&gt;
 : <span style="color:rgb(0,0,0)">When [GIRL]</span>
  @&gt;<span style="color:rgb(0,128,0)">Comment: initializes player 1 (PlayerB)</span>
  @&gt;<span style="color:rgb(128,128,128)">Script: pbChangePlayer(1)</span>
  @&gt;
 : <span style="color:rgb(0,0,0)">Branch End</span>
@&gt;<span style="color:rgb(0,128,0)">Comment: Shows the character's picture</span>
@&gt;<span style="color:rgb(128,128,128)">Script: pbShowPicture(2,pbGetPlayerGraphic,</span>
 : <span style="color:rgb(128,128,128)">     : 1,230,160)</span>
@&gt;<span style="color:rgb(0,0,0)">Text: Choose a name.</span>
@&gt;<span style="color:rgb(0,128,0)">Comment: opens the name entry screen and initializes the </span>
 : <span style="color:rgb(0,128,0)">        : Trainer object</span>
@&gt;<span style="color:rgb(128,128,128)">Script: pbTrainerName</span>
@&gt;<span style="color:rgb(0,128,0)">Comment: Displays the player's name</span>
@&gt;<span style="color:rgb(0,0,0)">Text: Hello, \PN.</span>
@&gt;<span style="color:rgb(0,128,0)">Comment: erases the character's picture</span>
@&gt;<span style="color:rgb(128,0,128)">Erase Picture: 2</span>
@&gt;<span style="color:rgb(0,128,0)">Comment: Stops autorun event</span>
@&gt;<span style="color:rgb(255,0,0)">Control Self Switch: A =ON</span>
@&gt;<span style="color:rgb(0,128,0)">Comment: Transfers player to start position</span>
@&gt;<span style="color:rgb(128,0,0)">Transfer Player:[011: Test Map], (009, 009), Down</span>
@&gt;
</pre>
		<p>In the Pok&eacute;mon Essentials editor, under "GLOBAL" within "Set Metadata", you can enter 
data for each player character in the settings PlayerA, PlayerB, etc.</p>
		<h2 id="resourcespecifications">Resource Specifications</h2>
		<p>A good program for graphics editing is <a href="http://getpaint.net/">Paint.NET</a>.
A good program for audio recording is <a href="http://google.com/search?q=audacity+audio+program">Audacity</a>.
Both programs are open-source and available free of charge.</p>
		<h3 id="pokemongraphicsandicons">Pok&eacute;mon Graphics and Icons</h3>
		<p>There should be five different image files for each Pok&eacute;mon (XXX is the Pok&eacute;mon's number):</p>
		<ul>
			<li><b>Graphics/Battlers/XXX.png</b> - Front of the Pok&eacute;mon. Measures 128x128 pixels, perhaps also larger.</li>
			<li><b>Graphics/Battlers/XXXs.png</b> - Shiny (different-colored) front of the Pok&eacute;mon. Measures 128x128 pixels, perhaps also larger.</li>
			<li><b>Graphics/Battlers/XXXb.png</b> - Back of the Pok&eacute;mon. Measures 128x128 pixels, perhaps also larger.</li>
			<li><b>Graphics/Battlers/XXXsb.png</b> - Shiny (different-colored) back of the Pok&eacute;mon. Measures 128x128 pixels, perhaps also larger.</li>
			<li><b>Graphics/Icons/iconXXX.png</b> - Icon of the Pok&eacute;mon. This is a two-frame animation measuring 128x64 pixels. Each of its frames has a size of 64x64 pixels.</li>
		</ul>
		<h4 id="placementofsprites">Placement of Sprites</h4>
		<p>To ensure optimal placement of Pok&eacute;mon sprites in battle, you should edit the <a href='#pbspokemontxt'>PBS/pokemon.txt</a> file for these three parameters for each Pok&eacute;mon species:</p>
		<ul>
			<li>BattlerPlayerY - Specifies the relative position of the back of the sprite (<b>Graphics/Battlers/XXXb.png</b>) on the battle screen.  A higher number means the back sprite is placed lower on the screen.</li>
			<li>BattlerEnemyY - Specifies the relative position of the front side sprite (<b>Graphics/Battlers/XXX.png</b>) on the battle screen.  A higher number means the front side sprite is placed lower on the screen.</li>
			<li>BattlerAltitude - Specifies how far from the ground the front sprite is placed, that is, this value will be higher than 0 if the sprite has the appearance of being suspended in the air.  A higher number means the front sprite is placed further from the ground.</li>
		</ul>
		<h4 id="alternateforms">Alternate Forms</h4>
		<p>For Pok&eacute;mon named SPINDA, extra spots are added to the graphic depending on the Pokemon.</p>
		<p>For the Pok&eacute;mon named UNOWN, there should be one set of files for each letter (from A to Z and continuing with "?" and "!". For example the letter 
A would have filenames of <b>Graphics/Battlers/201_00.png</b>, <b>Graphics/Battlers/201s_00.png</b>, and so on; and the letter B would
have filenames of <b>Graphics/Battlers/201_01.png</b>, <b>Graphics/Battlers/201s_01.png</b>, and so on.  
This is not necessary for the Pok&eacute;mon's icon (<b>Graphics/Icons/icon201.png</b>).  
Change the number 201 according to the actual national number for the Pok&eacute;mon named UNOWN in this case.</p>
		<p>Many other well-known species have alternate forms that are not implemented in Pok&eacute;mon Essentials.  
To give special forms to these and other species, edit the methods "pbLoadPokemonBitmapSpecies" and 
"pbPokemonIconFile" in the script section PokemonUtilities.  It may also be necessary to add methods to the 
script section PokeBattle_Pokemon that calculate which form to display depending on the Pok&eacute;mon's 
internal data (see PokeBattle_Pokemon in the <a href="advanced.html">advanced notes</a>).  This, 
however, is an <a href='#anoteonscripting'>advanced scripting feature</a>.</p>
		<h3 id="itemicons">Item Icons</h3>
		<p>Each item's icon has a filename of <b>Graphics/Icons/itemXXX.png</b> where XXX is the item's ID.  Measures 48x48 pixels.</p>
		<h3 id="mailpreview">Mail Preview</h3>
		<p>Each mail has a filename of <b>Graphics/Pictures/itemXXX.png</b> where XXX is the item's ID.  Measures 320x240 pixels.</p>
		<h3 id="pokemoncries">Pok&eacute;mon Cries</h3>
		<p>The cry of each Pok&eacute;mon has a filename of <b>Audio/SE/XXXCry.wav</b> where XXX is the Pok&eacute;mon's ID.</p>
		<h3 id="battlebackgrounds">Battle Backgrounds</h3>
		<p>
Each battle background consists of three parts: the background, a base for the player's Pokemon,
and a base for the enemy Pok&eacute;mon.  These files are given below (XXX stands for an arbitrary identifier):</p>
		<ul>
			<li><b>Graphics/Pictures/battlebgXXX.png</b> - Any size.</li>
			<li><b>Graphics/Pictures/playerbaseXXX.png</b> - Measures 256x32 pixels and has the appearance of a semi-ellipse.</li>
			<li><b>Graphics/Pictures/enemybaseXXX.png</b> - Measures 256x64 pixels and has the appearance of an ellipse.</li>
		</ul>
		<p>To change the battle background for the next battle, use the script:</p>
		<pre>
$PokemonGlobal.nextBattleBack="XXX"
</pre>
		<p>where XXX is an arbitrary identifier.  Here is an example.  Suppose you have created the following
three files as a custom battle background:</p>
		<ul>
			<li><b>Graphics/Pictures/battlebgDarkness.png</b></li>
			<li><b>Graphics/Pictures/playerbaseDarkness.png</b></li>
			<li><b>Graphics/Pictures/enemybaseDarkness.png</b></li>
		</ul>
		<p>Note that all three files end in the word "Darkness".  To access this background in a script,
you would use the following Script event command:</p>
		<pre>
$PokemonGlobal.nextBattleBack="Darkness"
</pre>
		<p>All three parts of the battle background can be <a href="#animatedpanoramasandfogs">animated image files</a>, including animated GIF files (with
a PNG extension).</p>
		<h3 id="trainergraphics">Trainer Graphics</h3>
		<p>
Each trainer type's graphic has a filename of <b>Graphics/Characters/trainerXXX.png</b>, where XXX is the ID of that trainer type.  Measures 128x128 pixels, perhaps also larger.  Trainers that appear in the Battle Tower should also have a RPGXP character image file named <b>Graphics/Characters/trcharXXX.png</b>, where XXX is the ID of that trainer type.</p>
		<h3 id="trainerback">Trainer Back</h3>
		<p>To define the back of a Trainer, for use in battles, 
create a graphic file with a size of 128x128 and the file must be located in Graphics/Pictures.
This graphic file is not specific to a player but rather to a trainer type.  The trainer back
has a filename of <b>trbackXXX.png</b> where XXX is the trainer type's ID.  Alternatively, the file
can have a size of 512x128, where each 128x128 block is a single frame of a 4-frame animation.
See the example at <b>Graphics/Pictures/trback000.png</b>.
</p>
		<h3 id="fishinganimation">Fishing Animation</h3>
		<p>The fishing animation is a five-frame animation.  It resembles the 16-frame character
sprites, but only the first five frames are used.  Its filename must be
<b>Graphics/Characters/fishingXXX.png</b>, where XXX is a trainer type's ID.  Example:
fishing000.png.  See below for the layout of the frames.</p>
		<pre>
Frame1   Frame2   Frame3   Frame4

Frame5   ------   ------   ------

------   ------   ------   ------

------   ------   ------   ------
</pre>
		<h3 id="badgeimage">Badge Image</h3>
		<p>The image for all Badges is located at <b>Graphics/Pictures/badges.png</b> (see <a href='#badges'>Badges</a>).
Measures 256x32 pixels.</p>
		<h3 id="trainercard">Trainer Card</h3>
		<p>The Trainer Card's image is found in 
<b>Graphics/Pictures/trcard.png</b>, and the background is found in 
<b>Graphics/Pictures/trcardbg.png</b>.  Measures 320x240 pixels.</p>
		<h3 id="border">Border</h3>
		<p>The border used in some screen size modes is found in 
<b>Graphics/Pictures/border.png</b>. Measures 640x480 pixels.</p>
		<h3 id="backgrounds">Backgrounds</h3>
		<p>The various screens use the following backgrounds (measuring 320x240 pixels or smaller):</p>
		<ul>
			<li>Pok&eacute;mon screen - <b>Graphics/Pictures/pokeselbg.png</b></li>
			<li>Pokedex screen - <b>Graphics/Pictures/pokedexbg.png</b></li>
			<li>Phone screen - <b>Graphics/Pictures/phonebg.png</b></li>
			<li>Name entry screen - <b>Graphics/Pictures/entrybg.png</b></li>
			<li>Evolution screen - <b>Graphics/Pictures/evobg.png</b></li>
			<li>Trading progress screen - <b>Graphics/Pictures/tradebg.png</b></li>
			<li>Game loading screen - <b>Graphics/Pictures/loadbg.png</b></li>
			<li>Log In screen - <b>Graphics/Pictures/loginbg.png</b></li>
			<li>Register screen - <b>Graphics/Pictures/registerbg.png</b></li>
		</ul>
		<p>The backgrounds can have any size, and <a href="#animatedpanoramasandfogs">animated image files</a>, including animated GIF files, can be used (even if they have
an extension of 'gif').</p>
		<h3 id="pokemontypesimage">Pok&eacute;mon Types Image</h3>
		<p>Images for all Pok&eacute;mon types is found in <b>Graphics/Pictures/types.png</b>.  They should
appear in the same order as in the script section PBTypes (see <a href='#pokemontypes'>Pok&eacute;mon Types</a>.)
</p>
		<h3 id="titles">Titles</h3>
		<p>The game's title screen can be changed by replacing the files Pic_1.png , Pic_2.png , and Start.png . Each of these files is found in the directory <b>Graphics/Titles</b>.</p>
		<h2 id="newwindowskinformat">New Window Skin Format</h2>
		<p>Pok&eacute;mon Essentials supports a new window skin format that allows different-sized window borders and different placement of text than usual. It involves a PNG file and a text file. The PNG file shows the look of a window at its minimum possible size. The corners and sides of the image will be adjusted to match the size of the window. An optional TXT file with the same name describes the sizes of the sides, corners, and borders. If the file is not given, it is assumed that the center 16x16 square is the center of the window and the window's sides and corners make up the rest of the image.</p>
		<h2 id="events">Events</h2>
		<p>Pok&eacute;mon Essentials comes with many predefined events for your use, and also contains many
new ways to define special kinds of events that otherwise wouldn't be possible with RPG Maker
XP alone.  This section will discuss the game's <a href='#predefinedevents'>predefined events</a>, the 
<a href='#switchesandvariables'>switches and variables</a> used in the game, and details on
implementing <a href='#timesensitiveevents'>Time-Sensitive Events</a>.  The rest of the section discusses <a href='#eventcommands'>Event Commands</a> 
and a way to <a href='#savingthegame'>save the game</a> via an event.</p>
		<h3 id="predefinedevents">Predefined Events</h3>
		<p>The following are definitions of events used in Pok&eacute;mon games.  These events include
<a href='#trees'>trees</a>, <a href='#boulders'>boulders</a>, <a href='#headbutttrees'>Headbutt trees</a>, <a href='#crackedrocks'>cracked rocks</a>,
and <a href='#doors'>doors</a>.  Other common kinds of events are <a href='#itemevents'>items</a> and <a href='#trainers'>Trainers</a>.</p>
		<h4 id="trees">Trees</h4>
		<p>Events that can be cut using the hidden move Cut are named Tree, have an Action 
Button trigger, and have the following structure:</p>
		<pre>
Conditional Branch:  Script:  Kernel.pbCut
 Script: pbEraseThisEvent
Branch End
</pre>
		<p>An animation for the tree being cut is possible by modifying the event just before "Script: pbEraseThisEvent".</p>
		<h4 id="boulders">Boulders</h4>
		<p>Events that can be pushed using Strength are named Boulder, have a Player Touch Trigger, and consist of the single event command "Script: pbPushThisBoulder".</p>
		<h4 id="headbutttrees">Headbutt Trees</h4>
		<p>Trees that a Pok&eacute;mon can use Headbutt on are named HeadbuttTree, have an Action Button Trigger, and consist of the single event command "Script: pbHeadbutt".</p>
		<h4 id="crackedrocks">Cracked Rocks</h4>
		<p>Rocks that can be smashed are named Rock, have an Action Button trigger, and have the following structure.</p>
		<pre>
Conditional Branch:  Script:  Kernel.pbRockSmash
 Script: pbEraseThisEvent
 Script: pbRockSmashRandomEncounter
Branch End
</pre>
		<h4 id="doors">Doors</h4>
		<p>Doors have two event pages, with the following structure:</p>
		<h5 id="eventpage1">Event Page 1</h5>
		<p>No conditions, Player Touch trigger</p>
		<p>The graphic should be of a closed door.</p>
		<pre>@&gt;<span style="color:rgb(128,0,0)">Set Move Route: This event (Ignore If Can't Move)</span>
 : <span style="color:rgb(128,0,0)">             : $&gt;SE: 'Entering Door', 80, 100</span>
 : <span style="color:rgb(128,0,0)">             : $&gt;Wait: 2 frame(s)</span>
 : <span style="color:rgb(128,0,0)">             : $&gt;Turn Right</span>
 : <span style="color:rgb(128,0,0)">             : $&gt;Wait: 2 frame(s)</span>
 : <span style="color:rgb(128,0,0)">             : $&gt;Turn Up</span>
 : <span style="color:rgb(128,0,0)">             : $&gt;Wait: 2 frame(s)</span>
 : <span style="color:rgb(128,0,0)">             : $&gt;Turn Left</span>
 : <span style="color:rgb(128,0,0)">             : $&gt;Wait: 2 frame(s)</span>
@&gt;<span style="color:rgb(0,0,0)">Wait for Move's Completion</span>
@&gt;<span style="color:rgb(128,0,0)">Set Move Route: Player (Ignore If Can't Move)</span>
 : <span style="color:rgb(128,0,0)">             : $&gt;Through ON</span>
 : <span style="color:rgb(128,0,0)">             : $&gt;Move Up</span>
 : <span style="color:rgb(128,0,0)">             : $&gt;Through OFF</span>
@&gt;<span style="color:rgb(0,0,0)">Wait for Move's Completion</span>
			<strong>@&gt;<span style="color:rgb(128,128,0)">Change Screen Color Tone: (-255,-255,-255,0), @6</span>
@&gt;<span style="color:rgb(0,0,0)">Wait: 6 frame(s)</span>
@&gt;<span style="color:rgb(128,0,0)">Transfer Player:[001: Pok&eacute;mon Center], (004, 007), Up, No Fade</span>
@&gt;<span style="color:rgb(128,128,0)">Change Screen Color Tone: (0,0,0,0), @6</span></strong>
@&gt;
		</pre>
		<p>The emphasized event commands are also useful for normal player transfers that don't involve doors.</p>
		<h5 id="eventpage2">Event Page 2</h5>
		<p>Condition 'Switch <b>s:tsOff?("A")</b> is ON', Autorun trigger</p>
		<p>The graphic should be of a closed door.</p>
		<pre>
Conditional Branch:  Script:  get_character(0).onEvent?
  Set Move Route: This event (Ignore If Can't Move)
  :             : $&gt;Turn Left
  Set Move Route: Player (Ignore If Can't Move)
  :             : $&gt;Move Down
  Wait for Move's Completion
  Set Move Route: This event (Ignore If Can't Move)
  :             : $&gt;Wait: 2 frame(s)
  :             : $&gt;Turn Up
  :             : $&gt;Wait: 2 frame(s)
  :             : $&gt;Turn Right
  :             : $&gt;Wait: 2 frame(s)
  :             : $&gt;Turn Down
  :             : $&gt;Wait: 2 frame(s)
  Wait for Move's Completion
Branch End
Script: setTempSwitchOn("A")
</pre>
		<p>This event page checks whether a player is on the door, and if so, moves the player one space down and closes the door. Therefore, event commands that cause the player to exit a building should have their destination placed on the door and not next to it.</p>
		<p>The door character image file should be arranged so that the first row shows a closed door, the second row an open door, the third row a partially closed door, and the fourth row a partially open door.</p>
		<h3 id="cutscenes">Cut Scenes</h3>
		<p>Pok&eacute;mon Essentials contains a way to skip or cancel certain events
designated as "cut scenes" by pressing F5.  This feature can be useful
if a player wants to skip the dialogue and advance the story.</p>
		<p>To make an event a cut scene, add to the event a Comment event command
consisting of the text "Cut Scene".  When the player presses F5, the event's
self switch A will be set to ON.  Therefore, the event should have another
event page with the Autorun trigger and the condition "Self Switch A is ON".
The event page should have the effect of canceling the effect of the cut
scene, perhaps by moving the player directly to the next destination or
doing any other necessary cleanup.</p>
		<h3 id="switchesandvariables">Switches and Variables</h3>
		<h4 id="scriptbasedswitches">Script-Based Switches</h4>
		<p>The event system in Pok&eacute;mon Essentials supports script-based switches, where an arbitrary script is evaluated. The switch is true as long as the condition on the switch's name remains true. Script-based switches are distinguished from regular switches using the prefix "s:". Be aware that due to the size limit on a switch's name, it may be necessary to use this kind of switch to call other methods that return a true or false value. Methods on script-based switches are called within the context of the Game_Event class.</p>
		<h4 id="temporaryselfswitches">Temporary Self-Switches</h4>
		<p>Each event in the game comes with a set of temporary self switches. This set is cleared whenever a map is entered. To check whether a temporary self switch is on, use a switch named "s:tsOn?(X)" where X is one of "A", "B", "C", or "D". To check whether it's off, use a switch named <b>s:tsOff?(X)</b>. To turn a temporary self switch on or off, use a script like:</p>
		<pre>
get_character(0).setTempSwitchOn("A")
</pre>
		<p>or:</p>
		<pre>
get_character(0).setTempSwitchOff("A")
</pre>
		<p>Temporary self switches are currently used in doors, but they have other uses where stand-alone stateful events are desired.</p>
		<h4 id="variables">Variables</h4>
		<p>Variables 1 through 25 are reserved for internal use by the game system. They are defined as follows:</p>
		<ul>
			<li>1: Temp Pok&eacute;mon Choice</li>
			<li>2: Temp Move Choice</li>
			<li>3: Temp Pok&eacute;mon Name</li>
			<li>4: Temp Move Name</li>
			<li>5: Temp Text Entry</li>
		</ul>
		<h4 id="eventspecificvariables">Event-Specific Variables</h4>
		<p>Each event in the game comes with its own variable, which can be used for any purpose. To retrieve a variable, call the script function "getVariable", and to set the value of the current event's variable, call the script function "setVariable(X)", where X is the value to set to the variable. To check the variable's value in an event page's condition, use the event function "variable" to help you. For example, to check whether the event's variable is equal to 1, you would use a switch named: "s:variable==1".</p>
		<h3 id="timesensitiveevents">Time-Sensitive Events</h3>
		<p>Thanks to temporary self-switches and event-specific variables, it is 
possible to implement events that are active only once each day. For an example, see the 
event on the northeast side of the Pok&eacute;mon Center.  Here is the basic 
structure of such events:</p>
		<h4 id="eventpage1">Event Page 1</h4>
		<p>No conditions, any trigger</p>
		<pre>
-- Do something here
Script:  pbSetEventTime      
</pre>
		<p>The script pbSetEventTime sets the event's variable to the current time, so that later the game can check whether the event "expires" and returns to normal. pbSetEventTime can also be used to set other events' variables to the current time. For example, pbSetEventTime(2) sets this event and the event numbered 2 on this map.</p>
		<h4 id="eventpage2">Event Page 2</h4>
		<p>Condition "Self Switch A is ON", any trigger</p>
		<pre>
-- Do something here
</pre>
		<p>This event page is used in cases when the event is currently "inactive"; for example, in the case of a tree that grows berries every day, there could be a message here that the tree is empty.</p>
		<h4 id="eventpage3">Event Page 3</h4>
		<p>Condition 'Switch <b>s:expired?&amp;&amp;tsOff?("A")</b> is ON', Autorun trigger</p>
		<pre>
Control Self Switch: A =OFF
Script:  setTempSwitchOn("A")
</pre>
		<p>This event page checks whether the event has expired and becomes active again.</p>
		<h3 id="counterevents">Counter Events</h3>
		<p>A counter event is one that is triggered when the player is a number of spaces away from the event's visibility range, even if there
is no counter tile separating them.</p>
		<p>To make one, name it Counter(X), where X is the maximum distance for the event to trigger, and use the Event Touch trigger.</p>
		<h3 id="sidestairs">Side Stairs</h3>
		<p>Side stairs (stairs on the side of a cliff) were introduced in Pok&eacute;mon Diamond and Pearl.
To make such an event, consider the following diagram.</p>
		<pre>
......||------
......||------
......|A------
......BA------
......B|------
......||------
</pre>
		<p>
In this diagram,"." represents flat ground; "-" represents rocky ground; and "|" represents cliffs. The letters A and B represent side stair events. Use the following event for the A events.
</p>
		<ul>
			<li>Trigger: Player Touch</li>
			<li>Condition: None</li>
		</ul><pre>
@&gt;Set Move Route: Player
 :              : $&gt;Move Lower Left
 :              : $&gt;Move Left
</pre>
		<p>
And use the following event for the B events.
</p>
		<ul>
			<li>Trigger: Player Touch</li>
			<li>Condition: None</li>
		</ul><pre>
@&gt;Set Move Route: Player
 :              : $&gt;Move Upper Right
 :              : $&gt;Move Right
</pre>
		<h4 id="onetiledeepsidestairs">One-Tile-Deep Side Stairs</h4>
		<p>Example:</p>
		<pre>
......|------
......|------
......A------
......A------
......|------
......|------
</pre>
		<p>Use the following event for the tiles labeled A.</p>
		<pre>
@&gt;Conditional Branch: Player is facing Left
  @&gt; Set Move Route: Player
    :              : $&gt;Move Lower Left
  @&gt;
 : Else
  @&gt; Set Move Route: Player
    :              : $&gt;Move Upper Right
  @&gt;
</pre>
		<h4 id="sidestairsmorethantwotilesdeep">Side Stairs More than Two Tiles Deep</h4>
		<p>Example:</p>
		<pre>
......||A----
......||A----
......A|A----
......A||----
......A||----
......|||----
</pre>
		<p>Use the following event for the tiles labeled A.</p>
		<pre>
@&gt;Conditional Branch: Player is facing Left
  @&gt; Set Move Route: Player
    :              : $&gt;Through ON
    :              : $&gt;Move Lower Left
    :              : $&gt;Move Lower Left  -- Repeat this command depending on depth of side stairs
    :              : $&gt;Move Left
    :              : $&gt;Through OFF
  @&gt;
 : Else
  @&gt; Set Move Route: Player
    :              : $&gt;Through ON
    :              : $&gt;Move Upper Right
    :              : $&gt;Move Upper Right  -- Repeat this command depending on depth of side stairs
    :              : $&gt;Move Right
    :              : $&gt;Through OFF
  @&gt;
</pre>
		<h3 id="randomprocessing">Random Processing</h3>
		<p>This technique is useful, e.g., for creating events that say a different thing every time the
player talks to it.  It uses the Control Variables event command to generate a random number,
and calls one of several conditional branches depending on the number generated.</p>
		<pre>
@&gt;Control Variables: [0001] = Random No. (0...3)
@&gt;Conditional Branch: Variable [0001] == 0
  @&gt;Text: Hello, this is text number 1.
  @&gt;
 : Branch End
@&gt;Conditional Branch: Variable [0001] == 1
  @&gt;Text: Hello, this is text number 2.
  @&gt;
 : Branch End
@&gt;Conditional Branch: Variable [0001] == 2
  @&gt;Text: Hello, this is text number 3.
  @&gt;
 : Branch End
@&gt;Conditional Branch: Variable [0001] == 3
  @&gt;Text: Hello, this is text number 4.
  @&gt;
 : Branch End
</pre>
		<h3 id="eventcommands">Event Commands</h3>
		<p>The following event commands have no effect in Pok&eacute;mon Essentials:</p>
		<ul>
			<li>Change Items</li>
			<li>Change Weapons</li>
			<li>Change Armor</li>
			<li>Change Party Member</li>
			<li>Battle Processing</li>
			<li>Shop Processing</li>
			<li>Name Processing</li>
			<li>Change HP</li>
			<li>Change SP</li>
			<li>Change State</li>
			<li>Change EXP</li>
			<li>Change Level</li>
			<li>Change Parameters</li>
			<li>Change Skills</li>
			<li>Change Equipment</li>
			<li>Change Actor Name</li>
			<li>Change Actor Class</li>
			<li>Change Actor Graphic</li>
			<li>Change Enemy HP</li>
			<li>Change Enemy SP</li>
			<li>Change Enemy State</li>
			<li>Enemy Recover All</li>
			<li>Enemy Appearance</li>
			<li>Enemy Transform</li>
			<li>Show Battle Animation</li>
			<li>Deal Damage</li>
			<li>Force Action</li>
			<li>Abort Battle</li>
		</ul>
		<p>The following event commands have been redefined in Pok&eacute;mon Essentials:</p>
		<ul>
			<li>Recover All (only "Entire Party" is supported)</li>
			<li>Show Text (uses a different message system)</li>
			<li>Show Choices (uses a different message system)</li>
			<li>Input Number (uses a different message system)</li>
			<li>Change Battle BGM (for the next battle only)</li>
			<li>Change Battle End ME (for the next battle only)</li>
			<li>Call Save Screen</li>
			<li>Change Gold</li>
			<li>Game Over</li>
			<li>Button Input Processing</li>
		</ul>
		<h3 id="savingthegame">Saving the Game</h3>
		<p>To save the game, use pbSaveScreen:</p>
		<pre>
Conditional Branch:  Script:  Kernel.pbSaveScreen
  -- The game was saved
Else
  -- The game was not saved
End
</pre>
		<h2 id="items">Items</h2>
		<h3 id="itemevents">Item Events</h3>
		<p>To create an item event, give it the following name: <b>Item:XXX</b>, where XXX is the internal name of the item (generally, the 
name of the item in all uppercase letters, with no spaces).  For example, <b>Item:POTION</b> creates a Potion item, and <b>Item:FULLHEAL</b>
creates a Full Heal item.</p>
		<p>To create a hidden item event, give it the following name: <b>HiddenItem:XXX</b>, where XXX is the internal name of the item (generally, the 
name of the item in all uppercase letters, with no spaces).</p>
		<p>Both types of item events will be converted to real events when you run the game from RPG Maker XP.</p>
		<h3 id="itemmanagement">Item Management</h3>
		<h4 id="checkingforitems">Checking for Items</h4>
		<p>The PokemonBag class has a function, pbQuantity, that you can use to check for the existence or amount of an item in the Bag. Here's how to use it:</p>
		<p>Conditional branch for checking for the existence of an item:</p>
		<pre>
$PokemonBag.pbQuantity(PBItems::POTION)&gt;0
</pre>
		<p>Script example: Printing the number of items</p>
		<pre>
itemname=PBItems.getName(PBItems::POTION)
itemqty=$PokemonBag.pbQuantity(PBItems::POTION)
print("#{itemqty}x #{itemname}")
</pre>
		<h4 id="addingremovingitems">Adding/Removing Items</h4>
		<p>To add an item:</p>
		<pre>
Conditional Branch:  Script:  $PokemonBag.pbStoreItem(::PBItems::POTION)
  -- The item was added
Else
  -- The item couldn't be added
Branch End
</pre>
		<p>This is the most generic of all functions that add items.</p>
		<p>To add an item received from a person, use event commands like the following.</p>
		<pre>
Conditional Branch:  Script:  Kernel.pbReceiveItem(::PBItems::POTION)
  -- The item was added
Else
  -- The item couldn't be added
Branch End
</pre>
		<p>It is not to be used as a replacement for <a href='#itemevents'>Kernel.pbItemBall</a>.</p>
		<p>To delete an item, use this as a Script event command:</p>
		<pre>
 $PokemonBag.pbDeleteItem(
    PBItems::POTION
   )
</pre>
		<p>To add more than one item at once, use this as a Script event command:</p>
		<pre>
5.times do
  $PokemonBag.pbStoreItem(
     PBItems::POKeBALL
  )
end
</pre>
		<p>or this newer syntax:</p>
		<pre>
$PokemonBag.pbStoreItem(
     PBItems::POKeBALL, 5
)
</pre>
		<h3 id="addingnewitems">Adding New Items</h3>
		<p>New items are added by editing <a href='#pbsitemstxt'>items.txt</a> in the PBS folder (See also <a href='#implementingnewitems'>Implementing New Items</a>).
Here are examples of entries in that file.</p>
		<h4 id="keyitems">Key Items</h4>
		<pre>500,LABKEY,LAB KEY,5,0,"This is a custom Key Item.",0,0</pre>
		<p>The first number, 500, is the item's ID, and the number 5 stands for the Key Items pocket.</p>
		<h4 id="technicalmachines">Technical Machines</h4>
		<pre>298,TM10,TM10,3,3000,"An attack that varies in type and intensity depending on the user.",3,0,,HIDDENPOWER</pre>
		<p>The number 3000 specifies the price.  The last field here, HIDDENPOWER, identifies this item's move.
When creating a new TM, also edit tm.txt in the PBS folder to add the list of species who can learn the move.  Here's an example for
the move Softboiled.</p>
		<pre>
[SOFTBOILED]
CHANSEY,BLISSEY,HAPPINY,TOGEPI,TOGETIC,TOGEKISS
</pre>
		<h4 id="hiddenmachine">Hidden Machine</h4>
		<pre>340,HM02,HM02,3,0,"A 2-turn move that hits on the 2nd turn. Use it to fly to any known town.",4,0,,FLY</pre>
		<p>Practically the same as above, except with a 4 after the description.</p>
		<h4 id="regularitem">Regular Item</h4>
		<pre>16,ICEHEAL,ICE HEAL,1,250,"A spray-type medicine. It defrosts a frozen POKeMON.",1,1</pre>
		<p>For items stored in the items pocket.  For details on the last two numbers, see fields 7 and 8
in the <a href="#header19">items.txt</a> section.</p>
		<h2 id="pokemonmart">Pok&eacute;mon Mart</h2>
		<p>To set up the Pok&eacute;mon Mart, use the following Script event command (you don't type the word "Script:"):</p>
		<pre>
@&gt;<span style="color:rgb(192,192,192)">Script: pbPokemonMart([</span>
 : <span style="color:rgb(192,192,192)">     : PBItems::POKeBALL,</span>
 : <span style="color:rgb(192,192,192)">     : PBItems::POTION,</span>
 : <span style="color:rgb(192,192,192)">     : PBItems::ANTIDOTE,</span>
 : <span style="color:rgb(192,192,192)">     : PBItems::TM20,</span>
 : <span style="color:rgb(192,192,192)">     : PBItems::TM21,</span>
 : <span style="color:rgb(192,192,192)">     : PBItems::TM22,</span>
 : <span style="color:rgb(192,192,192)">     : PBItems::ICEHEAL,</span>
 : <span style="color:rgb(192,192,192)">     : PBItems::REPEL,</span>
 : <span style="color:rgb(192,192,192)">     : PBItems::ESCAPEROPE])</span>
@&gt;

</pre>
		<p>Within the brackets is a list of items to be found in the Pok&eacute;mon Mart, separated by commas.
Note that each item begins with <samp>PBItems::</samp>.</p>
		
		<h2 id="pc">PC</h2>
		<p>To open the PC, use the following Script event command.</p>
		<pre>
Script:  pbPokeCenterPC
</pre>
		<p>It is to be used on any event with a PC.</p>
		<p>For the player's PC, use the following Script event command instead.</p>
		<pre>
Script:  pbTrainerPC
</pre>
		<h2 id="wildpokemonbattles">Wild Pok&eacute;mon Battles</h2>
		<p>To generate a wild Pok&eacute;mon battle, call pbWildBattle(X,Y,V,C) where X is the species number of the Pok&eacute;mon, and Y is its level. See PBSpecies for species IDs. The optional parameter V represents the number of a variable to store the result of the battle (1=won; 3=escaped; 4=caught), and the optional parameter C is true if the player can escape from the battle.</p>
		<p>To change the kinds of wild Pok&eacute;mon found in an area, you can use the "Set Encounters" option in the Pok&eacute;mon Essentials Editor (editor.exe). After doing so, it is enough to put grass tiles (or other tiles with <a href='#terraintags'>terrain tag</a> 2) on the map for wild Pok&eacute;mon to appear there -- no events are necessary. 
Pokemon Essentials supports two different encounter types: Land and Cave. For Land encounter types, wild Pok&eacute;mon will appear only on the grass. For Cave encounter types, wild Pok&eacute;mon will appear anywhere. Several other encounter types are also supported.</p>
		<h2 id="trainers">Trainers</h2>
		<p>Trainer events have a name of "Trainer(X)", where X is the maximum range of vision of the Trainer, that is, the
number of spaces that the Trainer can "see".  For example, if the event is named "Trainer(4)", the event will trigger
if the player is at least 4 spaces away from it.</p>
		<p>A Trainer event usually consists of these Comment event commands:</p>
		<pre>
Comment: Battle: Battle me now!
Comment: Type: CAMPER
Comment: Name: Cindy
Comment: EndSpeech: A very good battle, indeed.
Comment: EndBattle: Thanks for the battle.\mI enjoyed it.
</pre>
		<p>The game will convert these comments to appropriate event commands automatically
when the game is run from RPG Maker XP.  Also, the game will automatically detect whether
a Trainer is added when a battle with that Trainer would begin.  If not, you will be given 
the chance to define the Pok&eacute;mon that the Trainer has.  The meanings of each supported 
comment are defined below.</p>
		<ul>
			<li>Battle:  The text that the Trainer says before a battle begins.  
  Use "\m" to split the text into individual messages.  There can be more than
one of these comments, and each one specifies the introductory text for rematch battles.
If there is more than one Battle comment, then the Trainer can be registered in the phone.</li>
			<li>EndSpeech:  The text that the Trainer says when the player wins a battle.  There can be
more than one of these comments.</li>
			<li>RegSpeech:  The Trainer's speech when registering the Trainer's phone number.</li>
			<li>EndBattle:  The text that the Trainer says when a battle is over.  
Use "\m" to split the text into individual messages.  There can be
more than one of these comments.</li>
			<li>Type:  Trainer type.  This is an internal name (like LEADER_Roxanne) that is defined
under "Internal name" in the debug menu's Trainer Types option.</li>
			<li>Name:  Name of the Trainer.</li>
			<li>BattleID:  A number to distinguish Trainers with the same Trainer type and Trainer name.</li>
			<li>EndIfSwitch:  If the switch with this number is ON, the battle is treated as already over.  This is usually only set for Trainers within a Pok&eacute;mon Gym.</li>
<li>Backdrop: Sets the battle background for this Trainer battle (see <a href="#battlebackgrounds">Battle Backgrounds.</a>).</li>
		</ul>
		<h3 id="behindthescenes">Behind the Scenes</h3>
		<p>Please note that the instructions above are sufficient for simple Trainer battles.  Using the method shown below
is appropriate only for more complex battles, such as Gym Leader battles.</p>
		<p>If you inspect the generated event commands, you will see that Trainer events normally consist of two event pages. The first has an Event Touch trigger and has the following structure:</p>
		<pre>
Text:  I challenge you!
Conditional Branch: Script: pbTrainerBattle(PBTrainers::LEADER_Roxanne,"Roxanne",_I("Excellent.  You have earned the Stone Badge."))
  -- here you can add event commands to be run when the player wins, but this is not necessary
  Script: $Trainer.badges[0]=true
  Text:  \PN received the Stone Badge!
  Text:  The Stone Badge proves you can succeed in the Pok&eacute;mon League.
  Control Self Switch:  A =ON
Branch End
</pre>
		<p>Notice the parameters to pbTrainerBattle. Here is a list of the parameters:</p>
		<ul>
			<li>Parameter 1: Trainer type.</li>
			<li>Parameter 2: Trainer's name. The Trainer type and Trainer name must be found in the Trainer data file.</li>
			<li>Parameter 3: Dialogue that the Trainer says when the player wins. This parameter should be wrapped in _I() (with a capital i), to support localization of the text.</li>
			<li>Parameter 4: Optional. Whether the battle is a double battle. The default is false. If the battle is a double battle, an exception will be raised if the player has only one Pok&eacute;mon, so this case must be checked before the battle begins. For an example, see the two people to the left of the Pok&eacute;mon Center's PC.</li>
			<li>Parameter 5: Optional. A number to distinguish Trainers with the same Trainer type and Trainer name.  Specify 0 if there is only one such Trainer.</li>
			<li>Parameter 6: Optional. If <samp>true</samp>, the game will continue where the battle began even if the player loses the battle.
If the player loses, the option "Set handling when conditions do not apply" should be active for the conditional branch and commands to run when the 
player loses should be placed in the Else part of that branch.</li>
		</ul>
		<p>You can play music when a Trainer wants to battle by adding a "Play ME" event command as the 
first on the list of commands. Also, the Trainer event need not be named "Trainer(X)" if it only needs to be talked to in order 
to start a battle, as is the case for Gym Leaders and other special Trainers.</p>
		<p>The second event page has a condition of "Self Switch A is ON", and usually contains text that the 
Trainer says after the battle is over. The trigger must be other than Event Touch.</p>
		<p>The game system will automatically handle the case when two Trainers come into contact with the 
player at the same time; in that case, a multi battle will begin if the player has at least two Pokemon.</p>
		<p>For Trainer battles that span two events (as is the case with many double battles), the 
other event's self switch should be turned on when the player wins. You can use the pbSetSelfSwitch function for this.</p>
		<h3 id="doubletrainerbattles">Double Trainer Battles</h3>
		<p>To invoke a battle against two different Trainers, use the pbDoubleTrainerBattle function.</p>
		<pre>
@&gt; Conditional Branch: Script: <b>pbDoubleTrainerBattle(PBTrainers::CAMPER,"Andrew",0,_I("ABC"),PBTrainers::CAMPER,"Andrew",0,_I("DEF"))</b>
  @&gt; -- Event commands to be run when the player wins
  @&gt;
 : Else
  @&gt; -- Event commands to be run when the player loses.  For example:
  @&gt; Exit Event Processing
  @&gt;
 : Branch End
</pre>
		<p>The function's parameters are as follows:</p>
		<ul>
			<li>Parameter 1: Trainer 1's Trainer type.</li>
			<li>Parameter 2: Trainer 1's name. The Trainer type and Trainer name must be found in the Trainer data file.</li>
			<li>Parameter 3: For Trainer 1, a number to distinguish Trainers with the same Trainer type and Trainer name.  Specify 0 if there is only one such Trainer.</li>
			<li>Parameter 4: Dialogue that Trainer 1 says when the player wins. This parameter should be wrapped in _I() (with a capital i), to support localization of the text.</li>
			<li>Parameter 5: Trainer 2's Trainer type.</li>
			<li>Parameter 6: Trainer 2's name. The Trainer type and Trainer name must be found in the Trainer data file.</li>
			<li>Parameter 7: For Trainer 2, a number to distinguish Trainers with the same Trainer type and Trainer name.  Specify 0 if there is only one such Trainer.</li>
			<li>Parameter 8: Dialogue that Trainer 2 says when the player wins. This parameter should be wrapped in _I() (with a capital i), to support localization of the text.</li>
			<li>Parameter 9: Optional. If <samp>true</samp>, the game will continue where the battle began even if the player loses the battle.</li>
		</ul>
		<p>The important thing to note here is that each Trainer mentioned must have three or fewer Pokemon.</p>
		<h3 id="nightlytrainers">Nightly Trainers</h3>
		<p>The following example event shows not only how to make Trainers that fight only at night,
but also how to make Trainers that are active only at certain moments or under certain conditions (using the first conditional branch at the top of both event pages.)</p>
		<h4 id="eventpage1">Event Page 1</h4>
		<ul>
			<li>Trigger: Action Button</li>
			<li>Condition: (none)</li>
		</ul>
		<pre>
@&gt;<span style="color:rgb(0,0,255)">Conditional Branch: Script: Time.now.hour&lt;6||Time.now.hour&gt;=20</span>
  @&gt;<span style="color:rgb(0,0,0)">Text: Halt!  Who goes there?</span>
  @&gt;<span style="color:rgb(0,0,255)">Conditional Branch: Script: pbTrainerBattle(PBTrainers::POKeMANIAC,"Andrew",_I("Whoops..."),false,0)</span>
    @&gt;<span style="color:rgb(255,0,0)">Control Self Switch: A =ON</span>
    @&gt;
   : <span style="color:rgb(0,0,255)">Branch End</span>
  @&gt;
 : <span style="color:rgb(0,0,255)">Else</span>
  @&gt;<span style="color:rgb(0,0,0)">Text: I'm on guard for suspicious activity.</span>
  @&gt;
 : <span style="color:rgb(0,0,255)">Branch End</span>
@&gt;
</pre>
		<h4 id="eventpage2">Event Page 2</h4>
		<ul>
			<li>Trigger: Action Button</li>
			<li>Condition: Self Switch A is ON</li>
		</ul>
		<pre>
@&gt;<span style="color:rgb(0,0,255)">Conditional Branch: Script: Time.now.hour&lt;6||Time.now.hour&gt;=20</span>
  @&gt;<span style="color:rgb(0,0,0)">Text: Oh, sorry.  You may proceed.</span>
  @&gt;
 : <span style="color:rgb(0,0,255)">Else</span>
  @&gt;<span style="color:rgb(0,0,0)">Text: I'm on guard for suspicious activity.</span>
  @&gt;
 : <span style="color:rgb(0,0,255)">Branch End</span>
@&gt;
</pre>
		<h3 id="partnertrainers">Partner Trainers</h3>
		<p>In Pok&eacute;mon Essentials, a partner trainer can be registered so that he or she will appear
as the player's partner in Pok&eacute;mon battles.  To register a partner, use a Script event command:</p>
		<pre>pbRegisterPartner(PBTrainers::PkMnTRAINER_Cheryl,"Cheryl",0)</pre>
		<p>The first parameter is the internal name of the partner's trainer type, and the second parameter is the partner's name.  The parameter shown here as 0 is optional, it indicates which party to use for the partner trainer.  To define
the partner, choose "Edit Trainers" from the Pok&eacute;mon Essentials Editor (editor.exe).</p>
		<p>The partner will be registered as long as the player remains on the same map.  To deregister
the partner, use a Script event command:</p>
		<pre>pbDeregisterPartner</pre>
		<p>Special rules apply when the player is accompanied by a partner.  First, the entire party will
be healed at the end of the battle; and second, all opposing trainers must have at least two Pokemon
with them.  It is interesting, though, to make sure two opposing trainers face each other on the map.</p>
		<p>This feature can be used in combination with <a href='#dependentevents'>Dependent Events</a>.</p>
		<p>The back of the trainer is to be placed in Graphics/Pictures/ and has a filename
of trbackXXX.png, where XXX is the trainer type's ID number (see [[Trainer Backs]]).  Trainer backs for partner
trainers and other trainers are defined in the same way.</p>
		<h3 id="editingtrainersandbattles">Editing Trainers and Battles</h3>
		<p>The easiest way to edit trainers and trainer types is to use the options
"Edit Trainers" and "Trainer Types" options on the debug menu (press F9 during a game)
 or the Pok&eacute;mon Essentials editor (editor.exe).  Both options offer an intuitive way
of editing Trainer battles and Trainer types. (To delete a Trainer type or battle, 
select it and press Z.)</p>
		<h2 id="terraintags">Terrain Tags</h2>
		<p>The following terrain tags are defined:</p>
		<ul>
			<li>1: Ledges</li>
			<li>2: Grass</li>
			<li>3: Sand</li>
			<li>4: Rocky ground</li>
			<li>5: Deep water</li>
			<li>6: Still water (events will be reflected by these tiles)</li>
			<li>7: Normal water</li>
			<li>8: Waterfall</li>
			<li>9: Crest of waterfall</li>
			<li>10: Tall grass</li>
			<li>11: Underwater grass</li>
			<li>12: Ice (The player may slide on these tiles)</li>
			<li>13: Neutral (For use on tiles that the player could walk on but have special tiles underneath them.)</li>
		</ul>
		<p>More may be defined in the future. However, RPGXP's tileset editor only supports seven terrain tags. That's why Pok&eacute;mon Essentials contains a built-in terrain tag editor. It can be accessed by choosing "Edit Terrain Tags" from the "<a href='#debugmenu'>Debug</a>" option in the game menu, or from the Pok&eacute;mon Essentials Editor (editor.exe).</p>
		<h2 id="trainerobject">Trainer Object</h2>
		<p>PokeBattle_Trainer.new has two parameters: the first is the trainer name, and the second identifies the trainer type 
(such as PBTrainers::YOUNGSTER). The $Trainer object identifies the player. Here are some properties of the $Trainer object:</p>
		<ul>
			<li>$Trainer.pokedexSeen -- Number of Pok&eacute;mon seen</li>
			<li>$Trainer.pokedexOwned -- Number of Pok&eacute;mon owned</li>
			<li>$Trainer.numbadges -- Number of badges</li>
			<li>$Trainer.pokedex -- Whether the Pokedex was obtained</li>
			<li>$Trainer.party -- Array that specifies the player's current party of Pok&eacute;mon</li>
		</ul>
		<h2 id="pokemonmanagement">Pok&eacute;mon Management</h2>
		<h3 id="addingapokemon">Adding a Pok&eacute;mon</h3>
		<p>For an easy way to add a Pok&eacute;mon, call pbAddPokemon(X,Y) where X is the species number of the Pokemon, and Y is 
its level.  You can modify that function, which is located in PokemonUtilities, to remove the messages. 
Adding a Pok&eacute;mon may fail, so this statement should appear in a "Conditional Branch" event command.  An example is below.</p>
		<p>To learn how to create a new Pok&eacute;mon species, edit the file <a href='#pbspokemontxt'>pokemon.txt</a> in the PBS folder.</p>
		<pre>
@&gt;<span style="color:rgb(0,0,255)">Conditional Branch: Script: pbAddPokemon(PBSpecies::EEVEE,25)</span>
  @&gt;<span style="color:rgb(0,0,0)">Text: Pok&eacute;mon was received...</span>
  @&gt;
 : <span style="color:rgb(0,0,255)">Else</span>
  @&gt;<span style="color:rgb(0,0,0)">Text: Sorry, you have no room...</span>
  @&gt;
 : <span style="color:rgb(0,0,255)">Branch End</span>
@&gt;
</pre>
		<p><var>pbAddPokemon</var> will add the Pok&eacute;mon to either the party or the PC boxes.  
A similar method, <var>pbAddPokemonToParty</var>, will
adding a Pok&eacute;mon just to the party.</p>
		<h4 id="addingapokemonownedbyanotherperson">Adding a Pok&eacute;mon Owned by Another Person</h4>
		<p>Use the function "<var>pbAddForeignPokemon</var>" to add a Pok&eacute;mon owned by another person.  An example follows:</p>
		<pre>
@&gt;<span style="color:rgb(0,0,255)">Conditional Branch: Script: pbAddForeignPokemon(PBSpecies::SHUCKLE,20,_I("MARK"),_I("SHUCKIE"))</span>
  @&gt;<span style="color:rgb(0,0,0)">Text: Received a Pok&eacute;mon from Mark.</span>
  @&gt;
 : <span style="color:rgb(0,0,255)">Else</span>
  @&gt;<span style="color:rgb(0,0,0)">Text: You have no room to store the Pokemon...</span>
  @&gt;
 : <span style="color:rgb(0,0,255)">Branch End</span>
@&gt;
</pre>
		<p>Note the four parameters: species, level, owner's name, and nickname.  
(Specifying a nickname is optional.)
The Pok&eacute;mon added will also have a different ID number
from that of the Trainer, to underscore the fact that the player does not own it.</p>
		<p><var>pbAddForeignPokemon</var> will add the Pok&eacute;mon only to the Trainer's party.</p>
		<h4 id="modifyingapokemonafteraddingit">Modifying a Pok&eacute;mon After Adding It</h4>
		<p>A Pok&eacute;mon added to the party is always placed last on the Trainer's party.  However, using
<var>pbAddPokemon</var> may add the Pok&eacute;mon to the player's PC instead if the Trainer's party is full.  That's why
there should be a check for a full party before adding the Pok&eacute;mon.  Then, it becomes easy to modify
the Pok&eacute;mon as desired, for example to make it shiny (different-colored) or to change its gender.  Here's an example
which demonstrates this technique.</p>
		<pre>
@&gt;<span style="color:rgb(0,0,255)">Conditional Branch: Script: $Trainer.party.length&gt;=6</span>
  @&gt;<span style="color:rgb(0,0,0)">Text: You have no room to store the Pokemon...</span>
  @&gt;
 : <span style="color:rgb(0,0,255)">Else</span>
  @&gt;<span style="color:rgb(192,192,192)">Script: Kernel.pbAddPokemon(</span>
   : <span style="color:rgb(192,192,192)">     :   PBSpecies::MAGIKARP,10</span>
   : <span style="color:rgb(192,192,192)">     : )</span>
  @&gt;<span style="color:rgb(192,192,192)">Script: # Get the Pok&eacute;mon just added</span>
   : <span style="color:rgb(192,192,192)">     : p=$Trainer.party[</span>
   : <span style="color:rgb(192,192,192)">     : $Trainer.party.length-1]</span>
   : <span style="color:rgb(192,192,192)">     : # Make it shiny</span>
   : <span style="color:rgb(192,192,192)">     : p.makeShiny</span>
  @&gt;
 : <span style="color:rgb(0,0,255)">Branch End</span>
@&gt;

</pre>
<p>Another example:  Replace "p.makeShiny" above with the following to ensure that the Pok&eacute;mon always has
the move Tackle:</p>
<pre>
pbAutoLearnMove(p,PBMoves::TACKLE)
</pre>
<h4 id="modifyingapokemonafteraddingit">Adding a Pok&eacute;mon Silently</h4>
		<p>The following example shows how to create a Pokemon and add it to the Trainer's party.  It also shows
how the Pokemon's data can be modified before the Pokemon is added (see also "Modifying a Pokemon After Adding It, above).</p>
		<pre>
@&gt;<span style="color:rgb(0,0,255)">Conditional Branch: Script: $Trainer.party.length&gt;=6</span>
  @&gt;<span style="color:rgb(0,0,0)">Text: You have no room to store the Pokemon...</span>
  @&gt;
 : <span style="color:rgb(0,0,255)">Else</span>
  @&gt;<span style="color:rgb(192,192,192)">Script: p=PokeBattle_Pokemon.new(</span>
   : <span style="color:rgb(192,192,192)">     :   PBSpecies::MAGIKARP,10,$Trainer</span>
   : <span style="color:rgb(192,192,192)">     : )</span>
   : <span style="color:rgb(192,192,192)">     : # Make it shiny (optional)</span>
   : <span style="color:rgb(192,192,192)">     : p.makeShiny</span>
   : <span style="color:rgb(192,192,192)">     : # Add the Pokemon</span>
   : <span style="color:rgb(192,192,192)">     : $Trainer.party.push(p)</span>
  @&gt;
 : <span style="color:rgb(0,0,255)">Branch End</span>
@&gt;
</pre>
		
		<h4 id="addinganegg">Adding an Egg</h4>
		<p>You can use the function pbGenerateEgg to add an egg to the Trainer's party. Here's an example.</p>
		<pre>
@&gt;<span style="color:rgb(0,0,255)">Conditional Branch: Script: $Trainer.party.length&gt;=6</span>
  @&gt;<span style="color:rgb(0,0,0)">Text: You have no room to store the Egg...</span>
  @&gt;
 : <span style="color:rgb(0,0,255)">Else</span>
  @&gt;<span style="color:rgb(192,192,192)">Script: Kernel.pbGenerateEgg(</span>
   : <span style="color:rgb(192,192,192)">     :   PBSpecies::TOGEPI,5</span>
   : <span style="color:rgb(192,192,192)">     : )</span>
  @&gt;<span style="color:rgb(0,0,0)">Text: Received a Pok&eacute;mon Egg.</span>
  @&gt;
 : <span style="color:rgb(0,0,255)">Branch End</span>
@&gt;
</pre>
		<p><var>pbGenerateEgg</var> will add the egg only to the Trainer's party.</p>
		<h3 id="removingapokemon">Removing a Pok&eacute;mon</h3>
		<p>To remove a Pok&eacute;mon from the party, use the script <samp>$Trainer.party.delete_at(X)</samp> 
where X is the Pok&eacute;mon's position (starting at 0).  For example, to remove the first 
Pokemon in the party, use 0 for X.</p>
<h3 id="checkingforpokemon">Checking for Pok&eacute;mon</h3>
		<p>The script function pbHasSpecies? checks for a Pok&eacute;mon in the player's party.  Example:</p>
		<pre>
Conditional Branch:  Script:  pbHasSpecies?(::PBSpecies::CELEBI)
  -- The Pok&eacute;mon Celebi is in the party
Else
  -- The Pok&eacute;mon Celebi is not in the party
Branch End
</pre>
		<h2 id="graphicaleffects">Graphical Effects</h2>
		<h3 id="waterreflection">Water Reflection</h3>
		<p>Any tile with <a href='#terraintags'>terrain tag</a> 6 will display a reflection of any events on it.</p>
		<h3 id="lightsources">Light Sources</h3>
		<p>Any event can serve as a light source.  To make an event a light
source, name the event either "Light" or "OutdoorLight".  The
difference between them is that an event named "OutdoorLight" will
change its intensity according to the time of day.</p>
		<h3 id="shadows">Shadows</h3>
		<p>Any event can draw a shadow on the player.  To make an event a shadow
source, add a Comment event command consisting of the text "begin Shadow
Source".  You can add up to four additional Comment event commands for
extra parameters of the shadow, like this:</p>
		<pre>
Comment:  begin Shadow Source
Comment:  anglemin 180
Comment:  anglemax 360
Comment:  distancemax 350
Comment:  opacity 100
</pre>
		<p>To allow a shadow to appear on an event, add a Comment event
command consisting of the text "begin Shadow".</p>
		<h3 id="particleengine">Particle Engine</h3>
		<p>Pok&eacute;mon Essentials includes a particle engine for enabling special
graphical effects with particles. To add a particle effect to an event,
add to the event a Comment event command consisting of the text "Particle Engine Type"
and add another Comment event command consisting of one of the following:
fire, smoke, teleport, spirit, aura, soot, sootsmoke,
rocket, fixteleport, smokescreen, flare, splash, or
starteleport.</p>
		<h3 id="transitions">Transitions</h3>
		<p>In addition to normal transitions, Pok&eacute;mon Essentials also supports special
transitions that are not possible with transition bitmaps alone.  Most of them
require the file rubyscreen.dll, included with the distribution, since a screen capture
of the game is required for them.  These transitions
activate when a special pseudofile is entered into the Graphics.transition function.
For example, for the Breaking Glass transition, which breaks the screen into pieces,
the file would be "Graphics/Transitions/BreakingGlass".  That file need not exist,
but it can be used as a map and/or battle transition if that file does exist.  Even
if the file exists, it can even be zero-length and it will still work.</p>
		<p>The following transitions are available:</p>
		<p>RotatingPieces, BreakingGlass, Mosaic, Splash, ScrollDown, ScrollUp, ScrollLeft,
ScrollRight, RandomStripeV, RandomStripeH, ScrollDownRight, ScrollDownLeft, ScrollUpLeft,
ScrollUpRight</p>
		<p>Each special transition is contained in an object similar to that of Sprite -- it 
contains initialize, update, dispose, and disposed?.  Here are the four methods of a
transition object.</p>
		<ul>
			<li>initialize(numframes) - sets up the transition so that it lasts _numframes_
frames.  The setup can involve taking a screenshot of the
game with a call to "pbScreenshot", which returns a bitmap.  If the transition fails to
initialize, it should set its disposed flag to true.  It should also do so if _numframes_
is 0 or less.</li>
			<li>dispose - disposes all resources used by the transition and sets the disposed
flag to true.  This function should let itself be called multiple times.</li>
			<li>disposed? - returns true if the transition was disposed, that is, if the disposed
flag is true.</li>
			<li>update - updates the transition.  This method is called once per frame.  Once the
transition is over, it must call _dispose_ to clean up the transition's resources.</li>
		</ul>
		<p>New transitions are added to the <samp>judge_special_transition</samp> method, located in the
script section Transitions, within the list of "elsif" lines within that method.  For
example, a transition named "mytransition" would be added like this:</p>
		<pre>
    elsif dc=="mytransition"
      @@transition=MyTransition.new(duration)
</pre>
		<p>You can look at the different transition objects in SpriteWindow to get an idea of
how to create your own.</p>
		<h3 id="animatedpanoramasandfogs">Animated Images</h3>
<p>Pok&eacute;mon Essentials supports two kinds of animated images: GIF files and specially designed multi-frame images.
Animated panoramas and fogs, for example, allow special effects such
as twinkling stars in the night sky, or moving sand, etc.  Animated GIF files should have an extension of 'png'.  To
allow other kinds of images to be animated, add "[X]", where X is the number of frames in the animation, to the 
beginning of the image's file name, and make a horizontally arranged image of each frame in the animation.  For example, a 
four-frame panorama might have the name <b>[4]MyPanorama.png</b>, and the panorama's image would show
the four frames of the animation, arranged horizontally.</p>
<p>Animated images can be used as panoramas, fogs, and pictures, and as the <a href="#backgrounds">background of certain screens</a>, and as <a href="#battlebackgrounds">battle backgrounds on the battle screen</a>.</p>
<p>The Show Picture event command takes advantage of animated image support, and can even animate image files
automatically.  You may have to give the file an extension of "png", though, in order to make it appear
on the list of pictures in RPG Maker XP.</p>
		<h3 id="gifsupport">GIF Support/GIF Sprites</h3>
		<p>There is a special class defined, called GifSprite, which can load <a href="#animatedpanoramasandfogs">animated image files</a>, including animated GIF files,
and display them one frame at a time.  A GifSprite can be created within a script using <samp>GifSprite.new(X)</samp>
where X is the image's filename.  File extensions can be omitted.  The GifSprite's "update"
method must be called in order to animate the sprite. Its "setBitmap" method sets the file path of an animated image that the sprite refers to. Otherwise, a GifSprite acts exactly like a Sprite and can be used wherever sprites can be used.</p>
		<h2 id="messagesystem">Message System</h2>
		<p>This is the syntax used by the message system:</p>
		<ul>
			<li>\PN - Displays the player's name. (Please see <a href='#displayingaplayersuppliednameforatrainer'>Displaying a Player-Supplied Name for a Trainer</a> for information on how to display other Trainers' names using message commands.)</li>
			<li>\G - Displays a window showing the player's current money.</li>
			<li>\PM - Displays the player's current money within the message. (example: $1000)</li>
			<li>\v[n] - Displays the value of variable number n.</li>
			<li>\f[X] - Displays the face picture X near the message.  The image specified must be in the Graphics/Pictures/ folder.</li>
			<li>\c[n] - Displays the text that follows in color number n.  0=Black; 1=Blue; 2=Red; 3=Green; 4=Cyan; 5=Magenta; 6=Yellow; 7=Gray; 8=White.</li>
			<li>\[XXXXYYYY] - Displays the text in the base color XXXX and shadow color YYYY. Each color is a hexadecimal 15-bit RGB color. Examples:
<ul>
					<li>\[043c3aff] - Red</li>
					<li>\[06644bd2] - Green</li>
					<li>\[65467b14] - Blue</li>
					<li>\[318c675a] - Gray</li>
				</ul>
			</li>
			<li>\ch[a,b,<i>choices</i>] - Displays a list of choices.  _a_ is the number of a variable to store the chosen choice (the first choice is 0, etc.),
_b_ is the default choice in case the player cancels (or 0 if the player can't cancel; the first choice is 1, etc.), and _choices_ is a comma-separated list of choices.
This command is designed to support more than four choices, but the existing choice system can still be used if desired.</li>
			<li>\1 - Pauses the message. This is usually not necessary unless pauses are desired within a message.</li>
			<li>\n - Causes a line break.</li>
			<li>\b - Male dialogue colors.</li>
			<li>\r - Female dialogue colors.</li>
			<li>\wt[X] - Waits X frames, where a frame is equal to 1/20 of a second.</li>
			<li>\wtnp[X] - Wait and no pause.  Waits X frames, and makes the message close without pausing.</li>
			<li>\se[X] - Plays the sound effect (SE) named X.</li>
			<li>\me[X] - Plays the music effect (ME) named X.</li>
			<li>\\ - Displays the backslash character "\".</li>
			<li>\w[X] - Displays the message in the windowskin X.  If this field is blank, no windowskin will be used in the message display.</li>
			<li>&lt;b&gt; ... &lt;/b&gt; - Formats the text in bold.</li>
			<li>&lt;i&gt; ... &lt;/i&gt; - Formats the text in italics.</li>
			<li>&lt;u&gt; ... &lt;/u&gt; - Underlines the text.</li>
			<li>&lt;s&gt; ... &lt;/s&gt; - Draws a strikeout line over the text.</li>
			<li>&lt;r&gt; - Right-aligns the text until the next line break.</li>
			<li>&lt;br&gt; - Causes a line break.</li>
			<li>&lt;fn=X&gt; ... &lt;/fn&gt; - Formats the text in the specified font, or Arial
   if the font doesn't exist.</li>
			<li>&lt;fs=X&gt; ... &lt;/fs&gt; - Changes the font size to X.</li>
			<li>&lt;ac&gt; ... &lt;/ac&gt; - Centers the text.  Causes line breaks before and
   after the text.</li>
			<li>&lt;al&gt; ... &lt;/al&gt; - Left-aligns the text.  Causes line breaks before and
   after the text.</li>
			<li>&lt;ar&gt; ... &lt;/ar&gt; - Right-aligns the text.  Causes line breaks before and
   after the text.</li>
			<li>&lt;icon=X&gt; - Displays the icon X (in Graphics/Icons/).</li>
			<li>&amp;apos; - Converted to "'".</li>
			<li>&amp;lt; - Converted to "&lt;".</li>
			<li>&amp;gt; - Converted to "&gt;".</li>
			<li>&amp;amp; - Converted to "&amp;".</li>
			<li>&amp;quot; - Converted to double quotation mark.</li>
			<li>\l[n] - Changes the number of lines in the text box to n lines.</li>
			<li>\wu - Shows the textbox at the top of the screen.</li>
			<li>\wm - Shows the textbox at the middle of the screen.</li>
			<li>\wd - Shows the textbox at the bottom of the screen.</li>
		</ul>
		<p>It is not necessary or recommended to put spaces after a message command; such spaces will be reflected in the message
when it is rendered.  For example, "\bText" is preferred over "\b Text".</p>
		<p>It is also not necessary to add manual line breaks to text and limit Text event commands to two lines.
  The message system will automatically break the text as appropriate and scroll the text as needed if all of it doesn't fit on a single text box.</p>
		<h3 id="usingthemessagesysteminotherprojects">Using the Message System in Other Projects</h3>
		<p>To use the message system in other RPGXP projects, copy the script sections 
BitmapCache, DrawText, SpriteWindow, and PokemonMessages and put them just before the
last script in the script editor.  In addition, create a new script section that consists
of the following code:</p>
		<pre>
def _INTL(*args); return args[0]; end
def _ISPRINTF(*args); return args[0]; end
def _MAPINTL(*args); return args[1]; end
module Graphics
  def self.width; return 640; end
  def self.height; return 480; end
end
</pre>
		<p>Also, copy the following files to your project:</p>
		<ul>
			<li>Graphics/Pictures/uparrow.png</li>
			<li>Graphics/Pictures/downarrow.png</li>
			<li>Graphics/Pictures/leftarrow.png</li>
			<li>Graphics/Pictures/rightarrow.png</li>
			<li>Graphics/Pictures/pause.png</li>
			<li>Graphics/Pictures/selarrow.png</li>
			<li>Graphics/Windowskins/skin1.png</li>
			<li>Graphics/Windowskins/frlgtextskin.png</li>
			<li>Graphics/Windowskins/frlgtextskin.txt</li>
		</ul>
		<p>After doing so, the new message system will be ready to use.</p>
		<h2 id="backgroundmusic">Background Music</h2>
		<p>The background music for specific types of Trainers can be set from the <a href='#debugmenu'>debug menu</a>'s "Trainer Types" option,
under Battle BGM, Battle End ME, and Battle Intro ME. You may, for example, want to use one kind of music for Elite Four members and Gym Leaders.</p>
		<h3 id="defaultbackgroundmusic">Default Background Music</h3>
		<p>The default battle music can be changed by going to the "Set Metadata" option
within the debug menu or Pok&eacute;mon Essentials Editor, and choosing "GLOBAL".  There are four possible
settings for background music: TrainerBattleBGM, WildBattleBGM, TrainerVictoryME, and WildVictoryME.
The names are pretty self-explanatory. The BGM (background music) files mentioned here
are to be placed in the Audio/BGM/ directory, and the ME (music effects) files to the
Audio/ME/ directory.</p>
		<h3 id="changingthebattlemusic">Changing the Battle Music</h3>
		<p>You can change the background music to be played during a battle by using the 
"Change Battle BGM" and "Change Battle End ME" event commands.
These settings apply only to the next Pok&eacute;mon battle.</p>
		<h3 id="nightlymusic">Nightly Music</h3>
		<p>To specify a different BGM file to play at night, add an "n" to the filename before the
file extension.  For example, the nightly version of "song.mid" would be "songn.mid".
This will apply only to BGM files played on the map.</p>
		<h2 id="localizationandtranslation">Localization and Translation</h2>
		<p>All the text in Pok&eacute;mon Essentials can be translated to a different language using the 
"Extract Text/Compile Text" feature.</p>
		<p>To use this feature, open the Pok&eacute;mon Essentials editor (editor.exe) and select "Extract text".  
This function will save a file called "intl.txt" within the game folder.  Open the file, then translate every second line of the file.  
For example, if one part of the file reads:</p>
		<pre>
Good day.
Good day.
</pre>
		<p>you could translate it by changing it to:</p>
		<pre>
Good day.
Guten Tag.
</pre>
		<p>
After you are done translating, select "Compile Text" from the Debug menu.  This function will convert the text to another file called 
"intl.dat" within the game folder.  Rename that file and put it into the Data folder of the project, then close and restart the game.
</p><p>
The languages that the game uses can be found in the LANGUAGES array of the PokemonSystem script section.  That script defines an
array called LANGUAGES that contains two sample languages and message files, which are commented out.  Each entry in the array includes
the name of the language followed by the message data file's filename (like intl.dat), located in the Data folder.  Please note that
the mentioned files don't really exist.
</p>
		<h2 id="mapmakingconsiderations">Map Making Considerations</h2>
		<h3 id="avoidingblackregionsnearmapedge">Avoiding Black Regions Near Map Edge</h3>
		<p>In general, the border of a map needs to be wide enough so that the player can remain centered without any black spots on the edges. That means 7 tiles on the left and right edges of the map and six tiles on the top and bottom edges. You can easily add more room to a map using the following steps:</p>
		<ul>
			<li>Right-click on the map's name and select "Map Properties". You can set the width and height of the map to allow more room for edges.</li>
			<li>Right-click on the map's name and select "Shift". You can use this feature to move the map to the right and down as needed to allow more room for edges. You can then draw the edges with trees, etc.</li>
		</ul><p>On the other hand, this behavior of a black area outside the map is desired for indoor maps.</p>
		<h3 id="canstillsurfonwaterevenwithabridgeoverit">Can still surf on water even with a bridge over it</h3>
		<p>Water tiles have <a href='#terraintags'>terrain tag</a> 7, but due to the way the RPGXP map system
works, tiles without terrain tags are ignored in determining what terrain tag an area
has. In this case, bridge tiles have no terrain tag, but since a water tile is underneath
it, the bridge is inappropriately considered to have terrain tag 7 and could
thus be surfed on. To work around this, define a terrain tag for bridges (the neutral terrain
tag 13 is designed for this purpose). To do so,
open the game from RPG Maker XP, then open the in-game menu and select "<a href='#debugmenu'>Debug</a>", then
"Edit Terrain Tags." (Setting terrain tags higher than 7 is not possible in RPG Maker XP.)</p>
		<h3 id="gamefreezesduringmovement">Game freezes during movement</h3>
		<p>This usually happens when a move route is defined on an event and a "Wait for Move's Completion" event command follows it, but the event to be moved is prevented from moving. This problem is not limited to Pok&eacute;mon Essentials, though. To solve this problem, check the following in order, testing after each step.</p>
		<ul>
			<li>Is the event to be moved placed on an impassable tile? If so, make the tile in question passable (using the Tilesets tab of the database), or move the event to a passable tile.</li>
			<li>Are any events blocking the way? If so, move them using the Set Event Location event command.</li>
			<li>Add "Through ON" to the beginning of the event's move route, and add "Through OFF" to the end of the move route.</li>
			<li>Enable the setting "Ignore If Can't Move" for the event's move route.</li>
		</ul>
		<h2 id="commonmistakes">Common Mistakes</h2>
		<ul>
			<li>It is incorrect to change the player's starting position to any map other than the introduction, unless the player was configured properly beforehand (see "<a href='#introscreen'>Intro Screen</a>" for more information).  The game system will not work properly otherwise.</li>
		</ul>
		<h2 id="debugging">Debugging</h2>
		<h3 id="playtestingfunctions">Playtesting Functions</h3>
		<p>In playtests (when the $DEBUG global variable is set), the following functions are available:</p>
		<ul>
			<li>In a Pok&eacute;mon's option menu, the option SHOW VALUES displays the Pok&eacute;mon's Individual Values, Effort Values, personal ID, and happiness.</li>
			<li>In a Pok&eacute;mon's option menu, the option CHEAT CODES saves a file containing cheat codes for the Pok&eacute;mon. The generated codes are compatible with Visual Boy Advance.</li>
			<li>Holding CTRL will disable random encounters and skip Trainer battles. It will also make every tile passable.</li>
			<li>Holding CTRL while selecting the RUN command during a battle will allow you to flee or decide the outcome of the battle.</li>
			<li>Hidden moves can be used any time, even if the player doesn't have the right Badge or the right Pokemon.</li>
			<li>The DEBUG option appears on the main menu.</li>
		</ul>
		<h3 id="debugmenu">Debug Menu</h3>
		<p>The debug menu contains features useful for debugging or configuring a Pok&eacute;mon game.
It can be accessed by pressing F9 during a playtest or by choosing "Debug" from the game's main menu.</p>
		<ul>
			<li>RGSS Object Count - Gives the count of all graphical resources.</li>
			<li>Switches - Opens a window containing all defined switches.  To turn a switch on or off,
simply select it.</li>
			<li>Variables - Opens a window containing all defined variables.  To change a variable,
select it then press the left or right arrow keys.</li>
			<li>Set Terrain Tags - Opens a screen allowing you to set the terrain tags of each tile.
This feature is necessary because of the terrain tag limit set by RPG Maker XP.</li>
			<li>Warp to Map - Transfers the player to a random space on another map.</li>
			<li>Animation Editor - Opens the <a href='#animationeditor'>Animation Editor</a>.</li>
			<li>Fill Boxes - Fills all Pok&eacute;mon Boxes with one Pok&eacute;mon of each species.  These Pok&eacute;mon will
have a level of 50.</li>
			<li>Heal Party - Heals all Pok&eacute;mon in the player's party.</li>
			<li>Fill Bag - Adds a defined number of each item to the player's Bag.</li>
			<li>Extract Text - Extracts all text in the game for localization (see <a href='#localizationandtranslation'>Localization and Translation</a>).</li>
			<li>Compile Text - Compiles a text file into a localized format.</li>
			<li>Load Boxes</li>
			<li>Bitmap Cache - Saves information about the bitmap cache to bitmapcache.txt, in the game's folder.</li>
			<li>Reset Trainers - Resets all Trainers on the current map.</li>
			<li>Visual Editor</li>
			<li>Debug Console - Opens the debug console.  This is useful when debugging the game's scripts.  To send
text to the console, call echo(X) within a script, where X is the text to send.</li>
			<li>Compile Data - Compiles all data from the text files in the PBS folder.</li>
			<li>Set Encounters - Allows the Pok&eacute;mon encounters for each map to be modified.</li>
		</ul>
		<h2 id="pokedex">Pokedex</h2>
		<p>Use <samp>$Trainer.pokedex=true</samp> to add the Pokedex.</p>
		<h2 id="townmap">Town Map</h2>
		<p>Use <samp>pbShowMap</samp> to show the Town Map.</p>
		<h2 id="pokegear">Pokegear</h2>
		<p>Use <samp>$Trainer.pokegear=true</samp> to add the Pokegear.</p>
		<h2 id="runningshoes">Running Shoes</h2>
		<p>Use <samp>$PokemonGlobal.runningShoes=true</samp> to give Running Shoes to the player.</p>
		<h2 id="badges">Badges</h2>
		<p>To add a Gym Badge, use <samp>$Trainer.badges[X]=true</samp> where X is a number from 0 through 7 (though it is safe to assume that more Badges are possible).
It is normally set after the player defeats a Gym Leader.</p>
		<p>The constants found in the PokemonField script section (like BADGEFORCUT) determine which Badge enables which hidden move.</p>
		<p>The image for all Badges is located at Graphics/Pictures/badges.png.</p>
		<h2 id="phone">Phone</h2>
		<p>The Pokegear phone supports the storage of Trainers' phone numbers and enabling rematches.
A Trainer's phone number can be added if there are multiple battles for the same Trainer event.</p>
		<p>The possible dialogue from a phone can be edited in PBS/phone.txt.  It contains four sections:</p>
		<ul>
			<li>Greetings - Phrases that begin a phone call.</li>
			<li>Bodies - Phrases that follow a greeting and complete a phone call.</li>
			<li>Generics - Phrases that consist of a complete phone call.</li>
			<li>BattleRequests - Phrases that offer to battle.</li>
		</ul>
		<h2 id="nameraterandmovedeleter">Name Rater and Move Deleter</h2>
		<p>Looking at the events for the Move Deleter and Name Rater can be very instructive when learning to call such tasks as choosing a Pok&eacute;mon or choosing a move.</p>
		<h2 id="coincaseandgamecoins">Coin Case and Game Coins</h2>
		<p><samp>$PokemonGlobal.coins</samp> in a script retrieves the current number of coins.  Example:</p>
		<pre>
Text:  Here are some coins.
Script:  $PokemonGlobal.coins+=10
Text:  Obtained 10 game coins!
</pre>
		<p>(It may be useful here to add code to enforce a maximum number of coins:)</p>
		<pre>
Script:  $PokemonGlobal.coins+=10
:     :  if $PokemonGlobal.coins&gt;9999
:     :     $PokemonGlobal.coins=9999
:     :  end
</pre>
		<p>However, a player can't obtain Coins without a Coin Case, so that case should be checked first.</p>
		<pre>
Conditional Branch:  Script:  $PokemonBag.pbQuantity(PBItems::COINCASE)==0
  Text:  Oops!  Forgot the Coin Case!
  Exit Event Processing
Branch End
</pre>
		<p>
Another example:
</p>
		<pre>
Script:  $game_variables[1]=
:     :    $PokemonGlobal.coins
Text:  You have \v[1] game coin(s).
</pre>
		<h2 id="dependentevents">Dependent Events</h2>
		<p>The game system supports dependent events. Dependent events are those 
that follow the player character whenever the player moves. To add a dependent event, use this script:</p>
		<pre>
Kernel.pbAddDependency2(ID, "XXX", COMMONEVENT)
</pre>
		<p>where ID is the event's ID number (use <b>@event_id</b> to refer to the current event; to find out an event's 
ID number, double-click on the event, and the ID will appear on the dialog box shown), "XXX" is an arbitrary
name used to identify the event, and COMMONEVENT is the common event number to call when the player talks to the
dependent event.</p>
		<p>To remove a dependent event, use this script:</p>
		<pre>
Kernel.pbRemoveDependency2("XXX")
</pre>
		<p>where XXX is the name used in the call to "pbAddDependency2".</p>
		<p>Dependent events will remain even if a player leaves one map and enters another one.  The implementation
of dependent events was changed considerably since the September 22, 2008 release.</p>
<h2 id="ingametrades">In-Game Trades</h2>
<p>To make an in-game trade event, copy the example found in the man at the demo's Pok&eacute;mon Center.</p>
<p>Essentially, there are two steps to making a trade event.  First, add a Script event command
containing the command to choose a Pok&eacute;mon from a certain species, in this case Rattata:</p>
<pre>
pbChoosePokemon(1,2,
proc {|poke|
 !poke.egg? and 
  poke.species==PBSpecies::RATTATA
})
</pre>
<p>Then, if the player chose a Pok&eacute;mon (use a Conditional Branch checking whether the variable 1
does not equal -1, run a script containing the following code.  Note that the species received
is Haunter.</p>
<pre>
pbStartTrade(
$game_variables[1],
PBSpecies::HAUNTER,
"HAHA", # Nickname
"ANDY" # OT
)
</pre>
		<h2 id="movetutors">Move Tutors</h2>
		<p>The game system allows the creation of "move tutor" events, like in Pok&eacute;mon FireRed and LeafGreen. 
To use it, call the script function pbMoveTutorChoose(PBMoves::X, Y) where X is the name of a move, 
and Y is a list of species that can use that move. An example of its use follows. The move tutor 
here teaches the move Softboiled.</p>
		<pre>
@&gt;Conditional Branch: Script: pbMoveTutorChoose(PBMoves::SOFTBOILED,::SOFTBOILEDLIST)
  @&gt;Text: Move learned.
  @&gt;
 : Else
  @&gt;Text: Move not learned.
  @&gt;
 : Branch End
</pre>
		<p>
The script code in the conditional branch refers to the array called "::SOFTBOILEDLIST", which is a 
list of species that can learn Softboiled. It can appear in a new script section like this:
</p>
		<pre>
::SOFTBOILEDLIST=[
PBSpecies::CHANSEY,
PBSpecies::HAPPINY,
PBSpecies::BLISSEY,
PBSpecies::TOGEPI,
PBSpecies::TOGETIC,
PBSpecies::TOGEKISS
]
</pre>
		<h2 id="bicycle">Bicycle</h2>
		<p>Use the script "pbMountBike" and "pbDismountBike" to mount and dismount the bicycle.</p>
		<h2 id="miscellaneous">Miscellaneous</h2>
		<p>To change the player in script, use pbChangePlayer(X) where X is one of 0, 1, 2, or 3 and refers to players A, B, C, or D. The PlayerA setting is required while the other three settings are optional.</p>
		<p>In the Custom and Perspective map views, the day/night tinting will be disabled for any
event named "RegularTone".</p>
		<h2 id="suggestionsforcustomizingscripts">Suggestions for Customizing Scripts</h2>
		<p>For further scripting ideas, see the <a href="advanced.html">advanced topics</a>.</p>
		<p>This page cannot provide details on how to use the scripting language
Ruby.  For that, see the links provided in the Ruby language home page's 
<a href="http://www.ruby-lang.org/en/documentation/">Getting Started section</a>.
For reference material, consult the help file provided with RPG Maker XP.</p>
		<h3 id="displayingaplayersuppliednameforatrainer">Displaying a Player-Supplied Name for a Person</h3>
		<p>To make the player supply a name for a person, you can use this Script event command 
within an event (assuming that 25 is the variable you want to use):</p>
		<pre>
$game_variables[25]=
pbEnterText("Rival's name?",1,7,"Gary")
</pre>
		<p>"Gary", here, is the trainer's default name.  "Rival's name?" is the text to display as the title
of the name entry screen.</p>
		<p>The advantage of this approach is that the person's new name can be 
displayed in any Text event command using the command "\v[25]".</p>
		<p>(The following is optional, but necessary if the person is also a Pok&eacute;mon Trainer.)
Then modify the script section PokemonTrainers by adding the lines in bold (the following is from lines 14 to 16), 
assuming that the Trainer's trainer type is RIVAL and the Trainer's name is "???" (the lines not in bold serve only to 
identify where to place the code):</p>
		<pre>
   name=pbGetMessageFromHash(MessageTypes::TrainerNames,name)
<b>   if trainerid==PBTrainers::RIVAL &amp;&amp; trainername=="???"
     name=$game_variables[25] # Replace 25 with the variable number for the name
   end</b>
   opponent=PokeBattle_Trainer.new(name,thistrainerid)
</pre>
		<p>The code above replaces the name "???" with the name the player gave.</p>
		<h3 id="shinywildpokemon">Shiny Wild Pok&eacute;mon</h3>
		<p>To allow battles with shiny (different-colored) wild Pok&eacute;mon, you first need to define a switch for shiny Pok&eacute;mon, say, 50.  
Now, insert a new script section just before the last script section in the script editor.  
In that script, enter the following:</p>
		<pre>
Events.onWildPokemonCreate+=proc {|sender,e|
  pokemon=e[0]
  if $game_switches[50]
    pokemon.makeShiny
  end
}
</pre>
<p>(The code can also be used to modify the Pok&eacute;mon in a different way, such
as editing its Individual Values or changing the moves it knows.)</p>
		<p>Then, enable the switch (in this case, 50) before a wild battle with a shiny Pok&eacute;mon, and disable the switch when the battle is over. Example:</p>
		<pre>
Control Switches: [0050: Shiny] = ON
Script: pbWildBattle(
          ::PBSpecies::GYARADOS,30,1)
Control Switches: [0050: Shiny] = OFF
</pre>
		<p>The steps mentioned above affect only wild Pok&eacute;mon battles, and will not affect any other Pokemon, including Pok&eacute;mon added to the Trainer's party.</p>
		<h3 id="allowingaplayertoloseatrainerbattle">Allowing a Player to Lose a Trainer Battle</h3>
		<p>Here is an example of a battle where the player stays at the same position whether he or she loses or wins a Trainer battle.</p>
		<pre>
Conditional Branch: Script: pbTrainerBattle(PBTrainers::LEADER_Roxanne,"Roxanne",_I("Excellent."),false,0,<b>true</b>)
  -- here you can add event commands to be run when the player wins the battle
Else
  -- here you can add event commands to be run when the player loses the battle
Branch End
</pre>
		<h3 id="noshinypokemon">No Shiny Pok&eacute;mon</h3>
		<p>If you don't want shiny (different-colored) Pok&eacute;mon in your game, you can use the following script section
in the script editor:</p>
		<pre>
class PokeBattle_Pokemon
 def isShiny?
  return false # No Pok&eacute;mon are shiny
 end
end
</pre>
		<p>Then it should be safe to remove all shiny Pok&eacute;mon sprites (in Graphics/Battlers, with
names like poke001s.png and poke001sb.png).</p>
		<h3 id="pokemontypes">Pok&eacute;mon Types</h3>
		<p>The script section PBTypes contains instructions for adding new Pok&eacute;mon types.  To incorporate an icon of the new
type, edit the file Graphics/Pictures/types.png.</p>
<h3>Option Screen</h3>
<p>The script section PokemonOption displays the game's option screen.  There are several
predefined options such as Text Speed and Battle Style.  Options are placed in a class named PokemonSystem,
which is also found in the PokemonOption script section.  Find the array named "@PokemonOptions".
To add an option, define a setter and a getter for that option.  (The setter and getter are "proc" statements
that define an inline function used by each option.) To delete an option, comment it out or delete it.
The game's options may be placed in any order.</p>
<h3>Screen Size</h3>
<p>Change the screen size by changing the "width" and "height" variables in the script section SpriteResizer.
For best results, however, you should disable the option "Screen Size" in the script section "PokemonOption"
(see "Option Screen", above).</p>
		<h2 id="controllingeventswithscripts">Controlling Events with Scripts</h2>
		<p>The script section PokemonMessages contains several functions for controlling
events with scripts.  This includes applying move routes, waiting, and so on.
For an example of their use, see the script section PokemonDuel.</p>
		<h3 id="pbwaitx">pbWait(<i>x</i>)</h3>
		<p>Waits x frames, where a frame is 1/40 of a second.  While waiting, processes the
rest of the scene.</p>
		<h3 id="pbshakepowerspeedx">pbShake(<i>power</i>,<i>speed</i>,<i>x</i>)</h3>
		<p>Shakes the screen x frames, where a frame is 1/20 of a second. The shake has power "power"
and speed "speed". Returns immediately.</p>
		<h3 id="pbflashcolorx">pbFlash(<i>color</i>,<i>x</i>)</h3>
		<p>Flashes the screen x frames, where a frame is 1/20 of a second. 
in the specified color (Color).</p>
		<h3 id="pbtonechangealltoneduration">pbToneChangeAll(<i>tone</i>,<i>duration</i>)</h3>
		<p>Sets the screen color tone ("tone", Tone) on the screen and all pictures.
Fades the tone in for <i>duration</i> frames, where a frame is 1/20 of a second.</p>
		<h3 id="pbmoverouteeventcommands">pbMoveRoute(<i>event</i>,<i>commands</i>)</h3>
		<p>Runs a move route on an event (Game_Character).  To get the player, use "$game_player".
To get an event, use "$game_map.events[X]" where X is the event ID.  "event" can be nil.
"commands" is an array of move route commands, with each command followed by a set of parameters for that command.  Here
is an example of a move route defined for a player:</p>
		<pre>
    pbMoveRoute($game_player,[
      PBMoveRoute::ChangeSpeed,2, 
      PBMoveRoute::Backward
    ])
</pre>
		<p>Notice that the ChangeSpeed command is followed by a number specifying the speed.  The Backward
command has no parameters, however.  Here is a list of possible commands.  Most are self-explanatory.</p>
		<ul>
			<li>Taking no parameters: Down, Left, Right, Up, LowerLeft, LowerRight, UpperLeft, UpperRight, Random,
  TowardPlayer, AwayFromPlayer, Forward, Backward, TurnDown, TownLeft, TurnRight, TurnUp, TurnRight90,
  TurnLeft90, Turn180, TurnRightOrLeft90, TurnRandom, TurnTowardPlayer, TurnAwayFromPlayer,
  WalkAnimeOn, WalkAnimeOff, StepAnimeOn, StepAnimeOff, DirectionFixOn, DirectionFixOff, ThroughOn,
  ThroughOff, AlwaysOnTopOn, AlwaysOnTopOff</li>
			<li>Jump - 2 parameters: X offset, Y offset</li>
			<li>Wait - 1 parameter: Number of frames to wait (1/20 second)</li>
			<li>SwitchOn - 1 parameter: Switch number</li>
			<li>SwitchOff - 1 parameter: Switch number</li>
			<li>ChangeSpeed - 1 parameter: Desired movement speed (1-6)</li>
			<li>ChangeFreq - 1 parameter: Desired frequency (1-6)</li>
			<li>Graphic - 4 parameters: Filename, hue (0-359), direction (2=up, 4=left, 6=right, 8=up), pattern (0-3)</li>
			<li>Opacity - 1 parameter: New opacity (0-255)</li>
			<li>Blending - 1 parameter: New blend type (0=normal, 1=add, 2=subtract)</li>
			<li>PlaySE - 1 parameter: Name of the Sound Effect (SE) file to play</li>
			<li>Script - 1 parameter: Script to run</li>
			<li>ScriptAsync - 1 parameter: Script to run, except that the move route does not wait for its completion</li>
		</ul>
		<p>The function adds a ThroughOn command at the beginning and a ThroughOff command at the end of the move route.
This function returns immediately and does not wait for the move route to complete.  This function's return value
is the generated move route (RPG::MoveRoute).</p>
		<h2 id="configuringtheserver">Configuring the Server</h2>
		<p>The following is a guide for using the new server in Pok&eacute;mon Essentials (as of September 1, 2008), as
used in the online trade system. For those interested, the <a href="protocol.txt">protocol document</a> 
details the protocol used.</p>
		<p>The very small server, 32 KB, was written in C# using the .NET Framework 2.0.  It uses the Microsoft Access
database driver that is included in the .NET Framework.  To begin, copy the files in Server.zip to an empty folder
and open netserver.xml (in Notepad) to configure the details of the server used to listen for connections:</p>
		<ul>
			<li>The <b>hostname</b> (IP) can either be a subdomain, an IP address, or the special value "localhost", which
stands for the local computer.  Using a subdomain allows you to hide the IP address of your server, since
the subdomain is less likely than the IP address to change.</li>
			<li>The <b>port</b> (port) can be any number from 1 through 65535; the number 4000 appears to be a fine 
choice.</li>
		</ul>
		<p>Enter the hostname and port and save the file.  Then run netserver.exe and you're all finished. (It should 
say that the server is using the specified IP address and port.)  The source code to the server is included 
in Source.zip.</p>
		<h3 id="publishingtheserver">Publishing the Server</h3>
		<p>There are two ways to make the server available for others for use.  The easier way is to use a program called
"Hamachi".</p>
		<ol>
			<li>Download <a href="http://www.download.com/LogMeIn-Hamachi/3000-2651_4-10785910.html?tag=lst-1">"Hamachi"</a>
and install it.  You should choose the "Basic" configuration during the installation process.</li>
			<li>After installing Hamachi, run it and follow the instructions until you create a Hamachi network.  Then, use
the IP address found at the top of the Hamachi window in the netserver.xml file.</li>
			<li>If necessary, you should disable any firewalls you have.</li>
		</ol>
		<p>There is also a more difficult way to publish the server, which is detailed here.</p>
		<ol>
			<li>Create an account on <a href="http://www.dyndns.com/">DynDNS.com</a>.  After doing so, <a href="https://www.dyndns.com/account/services/hosts/add.html">log in</a>,
choose a hostname (subdomain), choose "Use auto detected IP address" in the IP address section, and finally choose "Create Host".
Use the hostname generated in this step in the netserver.xml file.</li>
			<li>Choose a port from 1 through 65535, such as 4000.  Use <a href="http://www.portforward.com/english/routers/port_forwarding/routerindex.htm">this page</a>
to find your router, and follow the instructions to forward the selected port to allow its use by outsiders.  (You can also
forward other ports in the same way, such as the HTTP port 80.)  If you don't have a router, skip this step.  If your
router is not listed, please contact your Internet Service Provider.</li>
			<li>If necessary, you should disable any firewalls you have.</li>
		</ol>
		<p>Finally, add an entry to "servers.txt" containing the hostname and port determined in the preceding steps.
An example of such a line is: "xxx.xxx.net:4000" or "111.222.33.44:4000".</p>
		<h2 id="history">History</h2>
<h3>January 9, 2008</h3>
<p>Accent marks added where appropriate</p>
<p>Changes and fixes to better support different window sizes</p>
<p>Better support for animated GIF files and animated images</p>
<p>Option screen is now more extensible</p>
<p>Added the hidden move Chatter</p>
<p>Maps copied to the Data folder are automatically imported</p>
<p>Day/night cycle changes depending on the season</p>
<p>Improved recording support</p>
<p>Backgrounds and title screen now supports animated images/GIFs</p>
<h3>December 14, 2008</h3>
<p>Honors 'Change Save Access', 'Change Menu Access' and 
'Change Encounter' event commands, as well as Button Input Processing</p>
<p>Bug fixes</p>
<p>Added support for 'Game Over' event command</p>
<p>Pause arrow</p>
		<h3 id="october42008">October 4, 2008</h3>
		<p>More improvements to dependent event system, removed map limitation
for partner trainers</p>
		<p>Allowed changes to maximum level</p>
		<h3 id="september222008">September 22, 2008</h3>
		<p>Fixed bugs that hindered playing from encrypted archives</p>
		<p>Reimplemented dependent events feature</p>
		<p>Changed text display algorithm</p>
		<p>Added feature to delete save files</p>
		<p>Disallowed running within caves and indoor maps</p>
		<h3 id="september142008">September 14, 2008</h3>
		<p>Added support for animated panoramas and fogs</p>
		<p>Allowed GIF files to be used as pictures in event commands</p>
		<p>Added documentation regarding publishing the server</p>
		<p>Fixed bug in tilemap for certain maps</p>
		<p>Added mechanism for changing the battle background for
a single battle (see documentation for details</p>
		<h3 id="september12008">September 1, 2008</h3>
		<p>Stabilized and updated online trade system and replaced Ruby server with a new C# server</p>
		<p>Moved advanced topics to a separate "Advanced Topics" file, made editing metadata.txt deprecated</p>
		<h3 id="august82008">August 8, 2008</h3>
		<p>Added more speech frames</p>
		<p>Improved <a href='#localizationandtranslation'>localization (translation)</a> support</p>
		<p>Added section on scenes to the notes</p>
		<p>Made editing trainers.txt, encounters.txt, and trainernames.txt deprecated</p>
		<h3 id="july102008">July 10, 2008</h3>
		<p>More message system improvements</p>
		<p>Toned down the nighttime color</p>
		<p>Performance improvement with thread priorities</p>
		<h3 id="july12008">July 1, 2008</h3>
		<h3 id="june242008">June 24, 2008</h3>
		<p>Added a very simple Pok&eacute;mon lab example</p>
		<p>Prevented throwing an error if the player has no Pok&eacute;mon</p>
		<p>Added support for common battle animations: "Common:StatUp",
"Common:StatDown", "Common:Burn", "Common:Frozen", "Common:Poison",
"Common:Sleep", "Common:Paralysis", and "Common:Confusion"</p>
		<p>Made Audio.dll optional</p>
		<p>Improved sandstorm animation a little</p>
		<h3 id="june12008">June 1, 2008</h3>
		<p>Added a very simple Gym example</p>
		<p>Added support for Recover All event command</p>
		<p>Miscellaneous fixes and improvements</p>
		<h3 id="may252008">May 25, 2008</h3>
		<ul>
			<li>Fixed bug where reflection can extend off the water for larger sprites.</li>
			<li>More improvements to message system</li>
			<li>Fixed bug where Pok&eacute;mon can earn more effort values than the maximum,
thus preventing wild stat changes</li>
		</ul>
		<h3 id="may212008">May 21, 2008</h3>
		<p>Improved on the message system and added instructions for incorporating
the message system into other projects.</p>
		<h3 id="may152008">May 15, 2008</h3>
		<p>New name entry system, implemented "Area" feature of the Pokedex.</p>
		<h3 id="may22008">May 2, 2008</h3>
		<ul>
			<li>Restructured game system for more extensibility</li>
			<li>Implemented roaming Pok&eacute;mon mechanism (Latios, Raikou, etc.).  See PokemonRoaming to learn how
to set it up.  This component is optional.</li>
			<li>Improved Poke Radar.  The Poke Radar component is now optional.</li>
			<li>Fixed animation bug where animation didn't reverse</li>
			<li>Added two functions to game editor</li>
			<li>Implemented in-game trade events</li>
		</ul>
		<h3 id="april262008">April 26, 2008</h3>
		<p>Implemented Poke Radar; rewrote Bitmap Caches to avoid memory problems;
made Trainer Pok&eacute;mon stronger than wild Pokemon.
Implemented Spinda's Spots; improved battle AI in Pokemon-switching decisions.</p>
		<h3 id="march12008">March 1, 2008</h3>
		<p>Another maintenance release.  Included an editor for easy access to the game
settings without opening RPG Maker XP.</p>
		<h3 id="february192008">February 19, 2008</h3>
		<p>Just a maintenance release, no features were added.  Code was changed and scripts added to 
make Pok&eacute;mon Essentials compatible with RGSS 2, and moved trainer, item, and species constants 
to a separate data file, to prevent problems that can occur when a project is saved.  Also, 
the Audio DLL was modified to help fix a bug in playback.</p>
		<h3 id="february112008">February 11, 2008</h3>
		<ul>
			<li>Fixed EXP gain animation problem</li>
			<li>Changed first map in demo to give more information in-game</li>
			<li>Added more formatting codes to message system</li>
			<li>Added debug option for teaching moves</li>
			<li>General memory fixes and improvements</li>
		</ul>
		<h3 id="february32008">February 3, 2008</h3>
		<ul>
			<li>More battle transitions added</li>
			<li>Hidden move animation and fishing animation</li>
			<li>Support for double wild battles and partner trainers</li>
			<li>Fixed potential problem where a wild encounter can run even
 if an event triggers on grass</li>
			<li>Fixed bugs in storage system</li>
			<li>Fixed bug where defining custom moves for a trainer causes an error</li>
		</ul>
		<h3 id="january242008">January 24, 2008</h3>
		<ul>
			<li>Increased number of storage boxes to 40</li>
			<li>Improved custom Tilemap's performance in large maps</li>
			<li>Changed font installation code</li>
			<li>Message system now supports "Change Text Options" event command</li>
			<li>Fixed bug in 640x480 mode where battle transitions were
  improperly displayed</li>
			<li>Fixed Revival Herb bug where it restored half HP and not full HP.</li>
			<li>New GifSprite class supports loading GIF images and animations</li>
			<li>Fixed bug that causes error after losing a Trainer battle</li>
		</ul>
		<h3 id="january192008">January 19, 2008</h3>
		<ul>
			<li>Fixed default map view to synchronize water
 animation, etc. in connected maps</li>
			<li>Added mechanism to define custom moves</li>
			<li>Changed code to make Pok&eacute;mon pictures larger than
 128x128 display properly.</li>
			<li>Reorganized script section PBTypes and added
 comments</li>
			<li>New feature checks the battery on laptop computers
 and gives a warning</li>
		</ul>
		<h3 id="january142008">January 14, 2008</h3>
		<ul>
			<li>Audio module was replaced with a custom one</li>
			<li>More changes to adapt to "Graphics.width/
  Graphics.height" convention</li>
			<li>Various bug fixes in data compiler</li>
			<li>Fixed bugs in animation generation routine</li>
			<li>Added option "Use PC" to debug menu</li>
			<li>Input module was replaced</li>
		</ul>
		<h3 id="january62008">January 6, 2008</h3>
		<ul>
			<li>Fixed bug where trainer battle intro music lingers in battle</li>
			<li>Move tutor support added</li>
			<li>Improvements in visual editor:<ul>
					<li>Full-color miniature maps</li>
					<li>Canvas can be dragged</li>
					<li>Global metadata is available by double-clicking</li>
				</ul></li>
			<li>More detailed error reporting in data compiler</li>
			<li>Events are stabler while walking in 240x160 mode</li>
			<li>Adopted "Graphics.width/Graphics.height" convention
  in script code, based on RGSS2</li>
			<li>Added "Quick Hatch" and "Trainer types" to debug menu</li>
			<li>Added more features to Pok&eacute;mon debug menus</li>
			<li>Mechanism for defining custom TMs and HMs</li>
		</ul>
		<h3 id="january12008">January 1, 2008</h3>
		<ul>
			<li>Fixed bug in data compiler for generated trainer
 type data</li>
			<li>Fixed bugs in item storage system</li>
			<li>Added the Town Map as an item</li>
			<li>Incorporated Wichu's changes to PokemonWeather and
 PokemonRegionMap</li>
			<li>Solved problem where changed weather was not applied
 when game is reloaded</li>
			<li>Added item handlers as a way of implementing new items</li>
			<li>Female and male signs were added to Pok&eacute;mon fonts;
 Nidoran species were renamed accordingly</li>
			<li>Nightly music, thanks to Wichu</li>
		</ul>
		<h3 id="december282007">December 28, 2007</h3>
		<ul>
			<li>Small changes to trade system</li>
			<li>Small change to variable section in debug menu</li>
			<li>Implemented mail and the mailbox</li>
			<li>Added more features to message system</li>
			<li>Changed money loss method to make it less grave;
  money won was set for each trainer type</li>
			<li>Added a special script-based transition system</li>
			<li>Changed first screen and project title to
  "Pokemon Essentials"</li>
			<li>Small bug fix in rubyscreen.dll</li>
			<li>Pressing F8 will take a screenshot of the game</li>
			<li>Implemented item storage</li>
			<li>Implemented the player's PC</li>
		</ul>
		<h3 id="december242007">December 24, 2007</h3>
		<ul>
			<li>Changes in trainer event system for supporting
 move routes, etc.</li>
			<li>Fixed performance bug in evolution animation</li>
			<li>Many edits to server and trade system, 
 released protocol and included server</li>
			<li>Fixed bug when game causes error after storing
 Pok&eacute;mon in daycare</li>
		</ul>
		<h3 id="december192007">December 19, 2007</h3>
		<ul>
			<li>Restructured the documentation and created
  an HTML Help version.</li>
			<li>Defined "counter events"</li>
			<li>Implemented the Safari Zone</li>
			<li>Implemented the Bug Catching Contest</li>
			<li>Added debug menu option for setting the player's money</li>
			<li>Begun to add comments to scripts within event commands,
  explaining what they do.</li>
		</ul>
		<h3 id="december142007">December 14, 2007</h3>
		<ul>
			<li>Implemented online trade system with Netplay 2.0</li>
			<li>Support for recording and playing back battles</li>
			<li>More bug fixes in battle system</li>
			<li>Added shift/summary menu to in-battle Pok&eacute;mon list</li>
			<li>Fixed bug where day/night land encounters failed to work
  properly (for real this time, I hope)</li>
			<li>Fixed bug where starting a new game can fail 
  during the running of an event</li>
		</ul>
		<h3 id="december92007">December 9, 2007</h3>
		<ul>
			<li>Made evolution and load screens "skinnable".</li>
			<li>Forced map to update to reflect changes in terrain tag editor</li>
			<li>Added character sprites for some Trainers</li>
			<li>Implemented Battle Tower/Battle Palace</li>
			<li>Various bug fixes in battle system (such as Choice Band)</li>
			<li>Added a game option to change the speech frame</li>
		</ul>
		<h3 id="december32007">December 3, 2007</h3>
		<ul>
			<li>Implemented the phone function</li>
			<li>Included a simplified way to add Trainer events</li>
			<li>Made sliding on ice a little more realistic</li>
			<li>Made walking in grass a little more realistic</li>
			<li>Combined Interpreter scripts into one section</li>
			<li>Fixed bug in data compiler where day/night land encounters failed to work</li>
			<li>Fixed subtle bug in jumping function</li>
			<li>Implemented AI in double battles</li>
			<li>Changed name entry screen and made that and other
 screens "skinnable"</li>
			<li>Can now convert RPGXP animations to battle animations; 
 implemented a mechanism for custom move animations</li>
		</ul>
		<h3 id="november232007">November 23, 2007</h3>
		<ul>
			<li>Moved background music code to PokemonUtilities and made
 music event commands work with that code.</li>
			<li>Added more battle sounds</li>
			<li>Made tileset editor more reliable with RPGXP.</li>
			<li>Added Pokeball graphics and catch animations</li>
			<li>Replaced encounter editor with a much more versatile visual
  editor</li>
			<li>New look for Pokegear thanks to OblivionMew</li>
			<li>Fixed bug where wrong base EXP values were used</li>
			<li>Improved path functions in animation editor</li>
		</ul>
		<h3 id="november132007">November 13, 2007</h3>
		<ul>
			<li>Day/night land encounters</li>
			<li>Moved all custom data files to Data instead of PBS</li>
			<li>Integrated animation editor in the debug menu</li>
			<li>Modified Shadow script to work properly in connected maps</li>
			<li>Added more screen size options</li>
			<li>Changed main procedure to handle hanging programs</li>
			<li>Added face support to the message system.</li>
		</ul>
		<h3 id="november62007">November 6, 2007</h3>
		<ul>
			<li>Added all Pok&eacute;mon new to the fourth generation</li>
			<li>Outdoor and indoor light sources</li>
			<li>Game data is compiled only when necessary upon test runs, included
 compile function and map warping in debug menu</li>
			<li>Added a duel minigame similar to Alael's on RMXP.ORG (may be used,
 e.g., after defeating a Gym Leader but before conferring a Badge)</li>
			<li>Added a way to cancel events designated as cut scenes
 using F5</li>
			<li>Modified Pok&eacute;mon screen to support choosing multiple Pok&eacute;mon</li>
			<li>Removed all unused scripts in the distribution</li>
			<li>Modified intro screen</li>
		</ul>
		<h3 id="october302007">October 30, 2007</h3>
		<ul>
			<li>Added encounter editor in Debug menu</li>
			<li>Fixed bug where surfing ends unexpectedly between connected maps</li>
			<li>Fixed bug in custom tilemap where a black line can appear between
 connected maps</li>
			<li>Added Ice <a href='#terraintags'>terrain tag</a> (12)</li>
			<li>Added more box graphics and included ability to jump to and rename boxes</li>
			<li>Added more evolution types and included support for custom evolution
  types</li>
			<li>Fixed bug where save file can fail to load in connected maps</li>
			<li>Corrected placement of Pok&eacute;mon sprites in battle</li>
			<li>RegionalNumbers setting in pokedex.txt</li>
		</ul>
		<h3 id="october262007">October 26, 2007</h3>
		<ul>
			<li>Implemented use of items by enemy Trainers</li>
			<li>Fixed bug where encounters were assigned to the wrong maps when they were connected</li>
			<li>Added predefined colors and multiple choice support to the message system</li>
			<li>Added a Map View option, which includes a new Perspective Tilemap</li>
			<li>Added Switch/Variable settings to Debug menu and made Debug menu accessible with F9</li>
			<li>Added more terrain tags and included location-appropriate battle backgrounds</li>
		</ul>
		<h3 id="october232007">October 23, 2007</h3>
		<ul>
			<li>Removed dependency on RGSS-RTP</li>
			<li>Added Trainer battle victory music settings in metadata.txt and trainernames.txt</li>
			<li>Implemented hidden items and Itemfinder</li>
			<li>Implemented Synchronize</li>
			<li>Added support for temporary self switches in events, as well as event-specific variables</li>
			<li>Added usage of items in and out of battle to items.txt</li>
			<li>Implemented robust, stand-alone door events</li>
			<li>Implemented events that are active only once a day (for fruit-bearing trees, etc.)</li>
			<li>Changed day/night tinting code to allow "Change Screen Color Tone" to work properly</li>
			<li>Redefined "Change Gold" to act on Trainer's money</li>
			<li>More performance changes in map connections feature</li>
		</ul>
		<h3 id="october202007">October 20, 2007</h3>
		<ul>
			<li>Implemented abilities that trigger on direct attacks</li>
			<li>Added custom music function to Pokegear radio</li>
			<li>Fixed bug where item GUARDSPEC wasn't defined</li>
			<li>Fixed bug where Repel step count wasn't decreasing</li>
			<li>Fixed bug where Flash darkness sprite disappeared after Pokegear was closed</li>
			<li>Fixed bug where trainer music failed to be set</li>
			<li>Added support for a new format for windowskins</li>
			<li>Improved performance of custom Tilemap class even more</li>
			<li>Some performance changes in map connections feature</li>
			<li>Using predefined Tilemap instead of custom Tilemap in 480x320 screen size</li>
		</ul>
		<h3 id="october142007">October 14, 2007</h3>
		<ul>
			<li>Added rudimentary support for battle animations</li>
			<li>All documentation for Pok&eacute;mon Essentials is in one place, the notes.html file</li>
			<li>Added Running Shoes flag; now running is allowed only when the player has Running Shoes; use the script $PokemonGlobal.runningShoes=true</li>
			<li>Added the Battle Scene option to the option screen.</li>
			<li>Added cries for each Pokemon.</li>
			<li>Implemented the Pokerus virus.</li>
			<li>Made statuses display in battle and in the summary screen.</li>
		</ul>
		<h3 id="october62007">October 6, 2007</h3>
		<ul>
			<li>Stabler Tilemap class -- Tile displacement problem was eliminated</li>
			<li>Trainer battles can be skipped in playtests by holding CTRL</li>
			<li>Internationalization support -- Texts can be extracted and compiled for localization</li>
			<li>Battle start transition included</li>
			<li>Finer day/night tinting</li>
			<li>WildBattleBGM and TrainerBattleBGM metadata classes</li>
			<li>Move speed problem fixed</li>
			<li>Title background music is set to that in the System tab of the database</li>
			<li>The Bag is no longer filled automatically in playtesting; instead use the "Fill Bag" option in the Debug menu.</li>
		</ul>
		<h3 id="october22007">October 2, 2007</h3>
		<ul>
			<li>Implemented the hidden moves Waterfall, Dive, and Flash</li>
			<li>Improved performance of redefined Tilemap class</li>
			<li>Removed 386-species limit; now any number of species is possible</li>
			<li>For demonstration, the Pok&eacute;mon Spiritomb is included</li>
			<li>Included metadata setting for running, surfing, and diving sprites</li>
		</ul>
		<h3 id="september282007">September 28, 2007</h3>
		<ul>
			<li>Support for the hidden moves Fly and Headbutt</li>
			<li>Flameguru's Pokegear script included</li>
			<li>Customizable region maps</li>
			<li>Script support for double battles and multi battles</li>
			<li>Debug menu option with integrated terrain tag editor</li>
			<li>Problems fixed with Rare Candy</li>
			<li>Problem fixed on player placement after jumping</li>
			<li>StorageCreator metadata setting added</li>
			<li>MapPosition metadata setting added</li>
			<li>Combined PokeBattle_Move_XX scripts into PokeBattle_MoveEffects</li>
		</ul>
		<h3 id="september152007">September 15, 2007</h3>
		<p>A Pokedex screen, a Pok&eacute;mon Mart screen, evolution support, a finished summary screen, as well as the Name Rater and Move Deleter. Also a method to add custom items to the game.</p>
		<h3 id="september72007">September 7, 2007</h3>
		<p>First release</p>
	</body>
</html>
